chore(build): Implement semantic release automation #47
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: Publish | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test: | |
name: Test | |
uses: ./.github/workflows/tests.yml | |
secrets: inherit | |
release: | |
name: Release | |
needs: test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
issues: write | |
pull-requests: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Deno | |
uses: denoland/setup-deno@v1 | |
- name: Install jq | |
uses: dcarbone/install-jq-action@v2 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v3 | |
with: | |
version: latest | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/*' | |
cache: 'pnpm' | |
- name: Release on GitHub | |
run: pnpm --package conventional-changelog-conventionalcommits --package semantic-release dlx semantic-release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update version in deno.json | |
run: | |
jq '.version = "${{ github.event.release.tag_name }}"' deno.json > deno.json.tmp | |
mv deno.json.tmp deno.json | |
- name: Publish package to JSR | |
run: deno publish |