mirror of
https://github.com/Paillat-dev/svelte-github-calendar.git
synced 2026-01-02 09:16:21 +00:00
💚 Enhance CI configuration and publishing process by extracting version from tags and updating package.json before publishing to NPM
This commit is contained in:
1
.github/workflows/CI.yaml
vendored
1
.github/workflows/CI.yaml
vendored
@@ -22,4 +22,3 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
contents: read
|
contents: read
|
||||||
secrets: inherit
|
|
||||||
|
|||||||
18
.github/workflows/publish.yaml
vendored
18
.github/workflows/publish.yaml
vendored
@@ -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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user