Skip to content

Commit

Permalink
👷 Add CI for publishing package (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryuapp authored Dec 21, 2023
1 parent 8b45cd6 commit 78ea5cb
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish package
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get tag version
if: startsWith(github.ref, 'refs/tags/')
id: get_tag_version
run: echo TAG_VERSION=${GITHUB_REF/refs\/tags\//} >> $GITHUB_OUTPUT

- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- name: Build npm package
run: deno task build:npm ${{steps.get_tag_version.outputs.TAG_VERSION}}

- name: Publish npm package
if: startsWith(github.ref, 'refs/tags/')
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: cd npm && npm publish

0 comments on commit 78ea5cb

Please sign in to comment.