chore: automatically pre-release beta #5
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: Build | |
on: | |
push: | |
branches: | |
- release | |
- beta | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
build: | |
strategy: | |
matrix: | |
build: | |
- os: ubuntu-latest | |
task: linux | |
- os: windows-latest | |
task: win | |
- os: macos-latest | |
task: mac | |
runs-on: ${{ matrix.build.os }} | |
steps: | |
- if: matrix.build.os == 'ubuntu-latest' | |
run: sudo snap install snapcraft --classic | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm install -g yarn | |
- run: yarn | |
- id: create_token # get ReleaseBot access token | |
uses: tibdex/github-app-token@v2 | |
with: | |
app_id: ${{ secrets.RELEASE_BOT_APP_ID }} | |
private_key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }} | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
id: semantic # Need an `id` for output variables | |
env: | |
GITHUB_TOKEN: ${{ steps.create_token.outputs.token }} | |
- run: yarn build | |
if: steps.semantic.outputs.new_release_published == 'true' | |
- run: yarn prepare-release | |
if: steps.semantic.outputs.new_release_published == 'true' | |
- run: yarn package ${{ matrix.build.task }} | |
if: steps.semantic.outputs.new_release_published == 'true' | |
env: | |
EP_PRE_RELEASE: 'true' | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} | |