Skip to content

Commit 8431bf4

Browse files
Merge pull request #273 from remarkablemark/ci/release
ci(github): add workflow `release.yml`
2 parents 2d7d332 + 9e25898 commit 8431bf4

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
release-please:
9+
runs-on: ubuntu-latest
10+
outputs:
11+
release_created: ${{ steps.release.outputs.release_created }}
12+
13+
steps:
14+
- name: Read package name
15+
run: echo ::set-output name=NAME::$(jq -r .name package.json)
16+
id: package
17+
18+
- name: Release Please
19+
id: release
20+
uses: GoogleCloudPlatform/release-please-action@v2
21+
with:
22+
token: ${{ secrets.GITHUB_TOKEN }}
23+
release-type: node
24+
package-name: ${{ steps.package.outputs.NAME }}
25+
26+
publish:
27+
needs: release-please
28+
runs-on: ubuntu-latest
29+
if: ${{ needs.release-please.outputs.release_created }}
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v2
33+
34+
- name: Use Node.js
35+
uses: actions/setup-node@v2
36+
with:
37+
registry-url: 'https://registry.npmjs.org'
38+
39+
- name: Install dependencies
40+
run: npm install
41+
42+
- name: Publish
43+
run: npm publish
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)