Skip to content

Commit

Permalink
chore: determine dist tag in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
guansss committed Dec 7, 2023
1 parent 1e2fd36 commit a8533c3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:

- run: npm ci
- run: npm run setup
- run: npm publish

# parse the tag name to determine the npm tag to use (most likely "beta").
# source: https://github.com/Leaflet/Leaflet/blob/35e053c6ff550991a0686865b87a34726e565ce5/.github/workflows/main.yml#L181C29-L181C29
- name: Publish to NPM
run: |
TAG=$(echo $GITHUB_REF_NAME | grep -oP '^v?\d+\.\d+\.\d+-?\K(\w+)?')
npm publish --tag ${TAG:-latest}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit a8533c3

Please sign in to comment.