diff --git a/.github/workflows/jsr-publish.yml b/.github/workflows/jsr-publish.yml index 0e1ee674..69b80b30 100644 --- a/.github/workflows/jsr-publish.yml +++ b/.github/workflows/jsr-publish.yml @@ -11,10 +11,24 @@ jobs: contents: read id-token: write # The OIDC ID token is used for authentication with JSR. steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 + - name: Checkout code at release tag + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} # Use the tag that triggered the event + + - name: Get the release tag name + id: get_tag + run: | + echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT + + - name: Set up Node.js + uses: actions/setup-node@v4 with: node-version: '20' cache: yarn - - run: yarn install - - run: npx jsr publish --allow-dirty + + - name: Install dependencies + run: yarn install + + - name: Publish to JSR with version from tag + run: npx jsr publish --allow-dirty --tag ${{ steps.get_tag.outputs.tag }} \ No newline at end of file diff --git a/release.sh b/release.sh index a0498693..a395c0ba 100755 --- a/release.sh +++ b/release.sh @@ -78,8 +78,6 @@ if [ $PREV_STEP -eq 1 ];then echo "👉 Creating a new release on GitHub" gh release create "v$new_version" --notes "$release_notes" - # npx jsr publish - # echo "👉 Published the new version to JSR" else echo -e $'\n' "${RED} \u2a2f Repository is not clean. ${NC} Please commit or stash your changes before running this script." $'\n' exit 1