Skip to content

Commit

Permalink
chore(publish/npm): accept tag
Browse files Browse the repository at this point in the history
  • Loading branch information
guesant committed Oct 31, 2024
1 parent d610638 commit a8671b3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/actions/publish/npm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
npm-token:
required: true
description: "NPM API Token for publish packages."
tag:
required: true
description: "Publish tag."
default: latest

runs:
using: "composite"
Expand All @@ -31,4 +35,4 @@ runs:

- name: Publish
shell: bash
run: pnpm publish -r --no-git-checks
run: pnpm publish -r --no-git-checks --tag ${{ inputs.tag }}
15 changes: 15 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,24 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract tag
id: extract-tag
run: |
TAG=latest
FILE=.changeset/pre.json
if [ -f ${FILE} ]; then
TAG=$(cat ${FILE} | jq .tag);
fi
echo tag: ${TAG}
echo "TAG=${TAG}" >> $GITHUB_OUTPUT
- name: Publish to the NPM registry
uses: ./.github/actions/publish/npm
with:
tag: "${{ steps.extract-tag.outputs.tag }}"
npm-token: "${{ secrets.NPM_TOKEN }}"

edge-publish-npm:
Expand Down

0 comments on commit a8671b3

Please sign in to comment.