Merge pull request #42 from Axis-Fi/changeset-release/main #84
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 | |
concurrency: ${{ github.workflow }}-${{ github.ref }} | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
jobs: | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: false | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "21.6.0" | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm i --frozen-lockfile | |
- name: Build | |
run: pnpm build | |
- name: Update packages versions or publish to npm | |
id: changesets | |
uses: changesets/action@v1 | |
with: | |
version: pnpm changeset version | |
publish: pnpm changeset publish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Push tags | |
if: steps.changesets.outputs.published == 'true' | |
run: git push -u origin HEAD --follow-tags |