Build and Publish #6
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: Build and Publish | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: "24" | |
| - run: npm install | |
| - name: Set version | |
| run: | | |
| CURRENT_VERSION=$(npm pkg get version | tr -d '"') | |
| RELEASE_VERSION="${CURRENT_VERSION%.*}.$(date +%Y%m%d)" | |
| echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV | |
| npm version "$RELEASE_VERSION" --no-git-tag-version | |
| - name: Publish to npm | |
| run: npm publish | |
| - name: Create GitHub Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: v${{ env.RELEASE_VERSION }} | |
| generateReleaseNotes: true |