Merge pull request #295 from scribd/kristianm/sourcegraph-batch-ubunt… #146
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: Release on Merge | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - next | |
| - next-major | |
| - alpha | |
| - beta | |
| jobs: | |
| release: | |
| runs-on: ubuntu-22.04 | |
| concurrency: ${{ github.ref }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: pnpm/action-setup@v2 | |
| with: | |
| version: 7.6.0 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: '16' | |
| cache: 'pnpm' | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm package | |
| - name: Semantic Release | |
| id: semantic | |
| uses: cycjimmy/semantic-release-action@v3 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| semantic_version: 19 | |
| extra_plugins: | | |
| @semantic-release/changelog@6 | |
| @semantic-release/git@10 | |
| @semantic-release/github@8 | |
| - name: Push updates to branch for major version | |
| if: | | |
| steps.semantic.outputs.new_release_published == 'true' && | |
| steps.semantic.outputs.new_release_channel == null | |
| run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Reset alpha branch | |
| if: | | |
| steps.semantic.outputs.new_release_published == 'true' && | |
| steps.semantic.outputs.new_release_channel == null | |
| run: "git push --force https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/alpha" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |