Publish master to GitHub Packages #17
This file contains hidden or 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 master to GitHub Packages | |
| on: | |
| workflow_run: | |
| workflows: [ "Run Tests" ] | |
| types: | |
| - completed | |
| branches: | |
| - master | |
| tags: | |
| - 'v*' | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'skipped' }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 24.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.x | |
| registry-url: "https://npm.pkg.github.com" | |
| scope: "@ikigai-systems" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Set version from commit SHA | |
| env: | |
| GITHUB_SHA: ${{ github.sha }} | |
| run: npm version --no-git-tag-version "$(jq -r .version package.json)-master.${GITHUB_SHA::7}" | |
| - name: Publish to GitHub Packages | |
| run: npm publish --tag prerelease | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |