Skip to content

Commit 5318aa9

Browse files
committed
update workflow
1 parent d6f1ce0 commit 5318aa9

File tree

1 file changed

+33
-15
lines changed

1 file changed

+33
-15
lines changed

.github/workflows/npm-publish.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,33 @@
1-
- name: Get tag version
2-
if: startsWith(github.ref, 'refs/tags/')
3-
id: get_tag_version
4-
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
5-
- uses: actions/setup-node@v2
6-
with:
7-
node-version: "18.x"
8-
registry-url: "https://registry.npmjs.org"
9-
- name: npm build
10-
run: deno run -A ./scripts/build.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
11-
- name: npm publish
12-
if: startsWith(github.ref, 'refs/tags/')
13-
env:
14-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
15-
run: cd npm && npm publish
1+
name: Build project and publish to npm
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Get tag version
13+
if: startsWith(github.ref, 'refs/tags/')
14+
id: get_tag_version
15+
run: echo ::set-output name=TAG_VERSION::${GITHUB_REF/refs\/tags\//}
16+
17+
- uses: denoland/setup-deno@v1
18+
with:
19+
deno-version: v1.x
20+
21+
- uses: actions/setup-node@v2
22+
with:
23+
node-version: "18.x"
24+
registry-url: "https://registry.npmjs.org"
25+
26+
- name: npm build
27+
run: deno run -A ./scripts/build.ts ${{steps.get_tag_version.outputs.TAG_VERSION}}
28+
29+
- name: npm publish
30+
if: startsWith(github.ref, 'refs/tags/')
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33+
run: cd npm && npm publish

0 commit comments

Comments
 (0)