ci: fix main branch name (#5) #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: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
install: | |
name: Install and build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Install dependencies | |
run: yarn | |
- name: Build dist | |
run: yarn run build | |
semantic-release: | |
needs: install | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/create-github-app-token@v1 | |
id: app-token | |
with: | |
app-id: ${{ secrets.DEPLOY_APP_ID }} | |
private-key: ${{ secrets.DEPLOY_APP_KEY }} | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
token: ${{ steps.app-token.outputs.token }} | |
# Make sure the value of GITHUB_TOKEN will not be persisted in repo's config | |
persist-credentials: false | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
VERSION.txt | |
package.json | |
package-lock.json | |
CHANGELOG.md | |
key: ${{ runner.os }}-sr-version-${{ github.sha }} |