💚 Enhance CI configuration and publishing process by extracting version from tags and updating package.json before publishing to NPM

This commit is contained in:
Paillat
2025-08-28 12:38:35 +02:00
parent 979eaac41e
commit 2c75031beb
2 changed files with 15 additions and 4 deletions

View File

@@ -22,4 +22,3 @@ jobs:
permissions: permissions:
id-token: write id-token: write
contents: read contents: read
secrets: inherit

View File

@@ -29,9 +29,21 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: pnpm install --frozen-lockfile run: pnpm install --frozen-lockfile
- name: Extract version from tag
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Publishing version: $VERSION"
- name: Update package.json version
run: |
pnpm version ${{ steps.version.outputs.version }} --no-git-tag-version
- name: Build package - name: Build package
run: pnpm build run: pnpm build
- uses: simenandre/publish-with-pnpm@v2 - name: Publish to NPM
with: run: pnpm publish --access public --provenance --no-git-checks
npm-auth-token: ${{ secrets.NPM_TOKEN }} env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}