Skip to content

Commit

Permalink
use --no-git-checks for publish since package.json will be changed
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamjan committed Dec 2, 2023
1 parent f3aafc4 commit 74d59ad
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches: [ 'main' ]
tags: [ 'v*' ]

# Build and publish package to the Github Packages service
# Packages from tagged commits will get the version of the git tag, and the npm tag "latest"
# Packages build from main, will get an auto-incremented version, and the npm tag "dev"

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -24,20 +28,22 @@ jobs:
with:
run_install: true

# packages created from a tag get the "latest" tag
- name: make an explicitly tagged release version
if: ${{ github.ref_type == 'tag' }}
run: |
npm version --no-git-tag-version from-git
pnpm version --no-git-tag-version from-git
echo "NPM_PUBLISH_TAG=latest" >> $GITHUB_ENV
# packages created from the main branch get a "dev" tag
- name: rolling versioned dev package from main
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}
run: |
npm version --no-git-tag-version `git describe --tags --long | sed s/^v//`
pnpm version --no-git-tag-version `git describe --tags --long | sed s/^v//`
echo "NPM_PUBLISH_TAG=dev" >> $GITHUB_ENV
- run: pnpm dist

- run: pnpm publish --tag "${{ env.NPM_PUBLISH_TAG }}"
- run: pnpm publish --no-git-checks --tag "${{ env.NPM_PUBLISH_TAG }}"
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 74d59ad

Please sign in to comment.