Skip to content

v0.2.3

v0.2.3 #20

Workflow file for this run

# 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 to npm
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
with:
ref: ${{ github.ref }}
- uses: actions/setup-node@v4
with:
node-version: 21
registry-url: https://registry.npmjs.org/
- uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm version from-git --no-commit-hooks --no-git-tag-version --allow-same-version
- run: pnpm install --frozen-lockfile
- run: pnpm run generate && pnpm run build:lib
- 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: 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