diff --git a/.github/actions/publish/npm/action.yml b/.github/actions/publish/npm/action.yml index 0168b925..bb97b0f7 100644 --- a/.github/actions/publish/npm/action.yml +++ b/.github/actions/publish/npm/action.yml @@ -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" @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ae071b8b..546fcb5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: