-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (52 loc) · 1.73 KB
/
publish.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
44
45
46
47
48
49
50
51
52
53
54
name: Publish
on:
pull_request:
branches:
- master
types: [closed]
jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.title, 'Release:')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run lerna bootstrap --ci
- name: Set version
id: lerna-version
shell: bash -ex {0}
run: |
version=$(node -p 'require("./lerna.json").version')
echo "::set-output name=version::${version}"
- name: Tag commit
uses: pkgdeps/git-tag-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
github_repo: ${{ github.repository }}
git_commit_sha: ${{ github.event.pull_request.head.sha }}
version: ${{ steps.lerna-version.outputs.version }}
git_tag_prefix: "v"
- run: npm run publish:ci
env:
PUBLIC_URL: '/'
REACT_APP_API_VERSION: 'v1'
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- run: npm run ghrelease:ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'https://github.com/${{ github.repository }}/releases/tag/v${{ steps.lerna-version.outputs.version }} is released 🎉'
})