Release new version #726
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release new version | |
on: workflow_dispatch | |
jobs: | |
build: | |
name: Build | |
uses: ./.github/workflows/build-and-upload.yml | |
secrets: | |
npm_token: ${{ secrets.npm_token }} | |
test: | |
name: Test | |
needs: build | |
if: ${{ needs.build.outputs.has_changes == 'true' }} | |
uses: ./.github/workflows/test.yml | |
secrets: | |
npm_token: ${{ secrets.npm_token }} | |
release: | |
name: Release | |
needs: [build, test] | |
if: ${{ needs.build.outputs.has_changes == 'true' }} | |
runs-on: ubuntu-latest | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.npm_token }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Run Setup | |
uses: ./.github/actions/setup | |
with: | |
npm_token: ${{ secrets.npm_token }} | |
- uses: ./.github/actions/git-creds | |
- uses: ./.github/actions/download-builds | |
- name: Generate new versions | |
run: yarn lerna version --exact --conventional-commits -y | |
- run: yarn config set registry https://registry.npmjs.org/ | |
- name: Setup .npmrc for publish | |
id: setup-npmrc | |
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > .npmrc | |
- name: Publish to npm | |
run: yarn lerna publish from-package -y | |
- name: Remove .npmrc | |
if: steps.setup-npmrc.outcome == 'success' | |
run: rm .npmrc |