-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (36 loc) · 1.17 KB
/
pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Pipeline
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- uses: actions/setup-node@main
with:
node-version: 18
- name: Build & Test
run: |
npm install
npm run build
npm run test
- name: Publish to >> npmjs.com
run: |
echo registry=https://registry.npmjs.org/ > .npmrc
echo //registry.npmjs.org/:_authToken=${TOKEN} >> .npmrc
npm publish --access public
env:
TOKEN: ${{ secrets.NPM_TOKEN }} # token has been issued on January 4, 2023. It's valid for 1 year
- name: Publish to >> github.com
run: |
echo registry=https://npm.pkg.github.com/ > .npmrc
echo //npm.pkg.github.com/:_authToken=${TOKEN} >> .npmrc
npm publish --access public
env:
TOKEN: ${{ github.token }}
- name: Fetch package version
run: node -p -e '`TAG=${require("./package.json").version}`' >> $GITHUB_ENV
- name: Commit release tag
uses: hole19/git-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}