Skip to content

Commit

Permalink
chore: fix release script
Browse files Browse the repository at this point in the history
  • Loading branch information
benyap committed Aug 13, 2023
1 parent 4db6d4f commit b66acb9
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,24 @@ jobs:
- name: Build package
run: pnpm build

- name: Get release version
uses: actions/github-script@v6
id: version
with:
script: |
const ref = context.ref
const release = ref.substring(10)
const releaseType = release.replace(/^(\d+\.)+\d+-?/, "").replace(/\.\d+$/, "")
core.setOutput("release", release)
core.setOutput("releaseType", releaseType || "latest")
console.log({ ref, release, releaseType })
- name: Set publish config
run: |
pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Publish to npm
run: |
pnpm publish --no-git-checks --access public --tag ${{ steps.version.outputs.releaseType }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit b66acb9

Please sign in to comment.