Skip to content

Commit 414442b

Browse files
authored
Merge pull request #4 from Himenon/ci/release-workflow
ci: add release workflow
2 parents 5de3cc6 + 873a083 commit 414442b

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Release Workflow
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
with:
13+
ref: master
14+
- uses: actions/setup-node@v1
15+
with:
16+
node-version: 12
17+
- run: |
18+
yarn install --frozen-lockfile
19+
yarn test
20+
yarn build
21+
release-github-npm-registry:
22+
needs: build
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v2
26+
with:
27+
ref: master
28+
- uses: actions/setup-node@v1
29+
with:
30+
node-version: 12
31+
registry-url: https://npm.pkg.github.com/
32+
scope: '@Himenon'
33+
- run: |
34+
yarn install --frozen-lockfile
35+
yarn build
36+
echo "//npm.pkg.github.com/:_authToken=$GITHUB_NPM_TOKEN" >> ~/.npmrc
37+
yarn lerna publish from-package --yes --registry https://npm.pkg.github.com/:_authToken=${GITHUB_NPM_TOKEN}
38+
env:
39+
GITHUB_NPM_TOKEN: ${{secrets.GITHUB_NPM_TOKEN}}
40+
release-npm-packages:
41+
needs: build
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v2
45+
with:
46+
ref: master
47+
- uses: actions/setup-node@v1
48+
with:
49+
node-version: 12
50+
registry-url: https://registry.npmjs.org/
51+
- run: |
52+
yarn install --frozen-lockfile
53+
yarn build
54+
echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" >> ~/.npmrc
55+
yarn lerna publish from-package --yes
56+
env:
57+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
58+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)