name: Publish NPM Package Release on: workflow_call: inputs: version: required: true type: string workflow_dispatch: inputs: version: required: true type: string description: The version to release manually jobs: publish-npm-packages: name: Publish NPM Packages runs-on: ubuntu-latest strategy: matrix: node-version: [16.x] steps: - name: Checkout Release uses: actions/checkout@v3 with: fetch-depth: 0 ref: ${{ inputs.version }} - name: Using Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - name: Generate NPM packages run: | yarn install --frozen-lockfile yarn run build - name: Publish NPM packages run: | npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}" DIST_TAG=$(cat lerna.json | jq '.version' --raw-output | xargs npm exec -- @k8slens/semver --prerelease 0) yarn lerna \ publish from-package \ --no-push \ --no-git-tag-version \ --yes \ --dist-tag ${DIST_TAG:-latest} env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }}