v0.3.6 #31
Workflow file for this run
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
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | |
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages | |
name: Publish package | |
on: | |
release: | |
types: [created] | |
workflow_dispatch: | |
permissions: | |
id-token: write | |
contents: write | |
jobs: | |
publish-npm: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./api | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout | |
with: | |
ref: ${{ github.ref }} | |
- uses: actions/setup-node@v4 | |
name: Setup Node.js | |
with: | |
node-version: 21 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v4 | |
name: Setup pnpm | |
with: | |
version: 9 | |
- name: Update package.json | |
if: github.event_name == 'release' | |
run: pnpm version from-git --no-commit-hooks --no-git-tag-version --allow-same-version | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Generate JSON schemas and build library | |
run: pnpm run generate && pnpm run build:lib | |
- name: Publish to npm | |
run: | | |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc | |
pnpm publish --provenance --no-git-checks --tag ${{ github.event.release.prerelease && 'next' || 'latest' }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish to JSR | |
run: npx jsr publish --allow-slow-types --allow-dirty | |
- name: Push version changes to main branch | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "bump @kulupu-linku/sona version ${{ github.event.release.tag_name }}" | |
branch: ${{ github.event.repository.default_branch }} | |
file_pattern: api/package.json |