💚 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

@@ -29,9 +29,21 @@ jobs:
- name: Install dependencies
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
run: pnpm build
- uses: simenandre/publish-with-pnpm@v2
with:
npm-auth-token: ${{ secrets.NPM_TOKEN }}
- name: Publish to NPM
run: pnpm publish --access public --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}