fix: alpha release #157
This file contains hidden or 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: Build-Test-Release | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - alpha | |
| jobs: | |
| build-test-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| # Keep in sync with volta -> node version in package.json | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: yarn | |
| - name: Determine next version | |
| id: next_version | |
| uses: cycjimmy/semantic-release-action@v4 | |
| with: | |
| dry_run: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Update version in package.json | |
| if: steps.next_version.outputs.new_release_version | |
| run: npm version ${{ steps.next_version.outputs.new_release_version }} --no-git-tag-version | |
| - name: Sync with crowdin | |
| env: | |
| BLOOM_CROWDIN_TOKEN: ${{ secrets.BLOOM_CROWDIN_TOKEN }} | |
| run: | | |
| if [ "${{ github.ref }}" = "refs/heads/master" ]; then | |
| yarn strings:sync | |
| else | |
| yarn strings:download | |
| fi | |
| - name: Build package | |
| run: | | |
| yarn build:standalone | |
| yarn build:sharedlib | |
| - name: Run tests | |
| run: yarn test | |
| - name: Clean up package.json | |
| # We used to use the clean-publish package to do this, but when | |
| # we switched to using semantic-release, we had to do it manually. | |
| run: npm pkg delete scripts && npm pkg delete devDependencies && npm pkg delete dependencies | |
| - name: Publish package | |
| id: semantic_release | |
| uses: cycjimmy/semantic-release-action@v4 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Trigger dependent builds if release published | |
| if: steps.semantic_release.outputs.new_release_published == 'true' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'trigger-builds.yml', | |
| ref: context.ref | |
| }) |