-
Notifications
You must be signed in to change notification settings - Fork 14
40 lines (38 loc) · 1.15 KB
/
release.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
name: Release SDK if needed
on:
pull_request:
branches: main
types: closed
jobs:
release:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.head.ref, 'release/')
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- name: Publish to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create Release tag
id: create-tag
env:
PR_REF: ${{ github.event.pull_request.head.ref }}
run: |
release_tag=$(echo "$PR_REF" | cut -d "/" -f2)
echo "::set-output name=release-tag::$release_tag"
- name: Make new release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.create-tag.outputs.release-tag }}
commit: main
body: ${{ github.event.pull_request.body }}