123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- name: "Build and Publish"
- on:
- push:
- branches:
- - main
- env:
- PR_TITLE: "Create Release"
- COMMIT_MSG: "chore: create new release"
- concurrency: ${{ github.workflow }}-${{ github.ref }}
- jobs:
- publish:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- node-version: [22.x]
- permissions:
- contents: write # For pushing Git tags and creating releases
- pull-requests: write # For creating the changesets relese PR
- id-token: write # The OIDC ID token is used for authentication with JSR
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: ${{ matrix.node-version }}
- - name: Install dependencies
- run: npm ci
- - name: Build package
- run: npm run build-all
- - name: Create artifact
- uses: actions/upload-artifact@v4
- with:
- name: dist
- path: dist/
- retention-days: 2
- - name: Create release or publish package
- uses: changesets/action@v1
- id: changesets
- with:
- publish: npm run publish-package
- commit: ${{ env.COMMIT_MSG }}
- title: ${{ env.PR_TITLE }}
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|