-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (46 loc) · 1.7 KB
/
publish-new-version.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
55
56
57
58
59
60
name: Bump Version and Publish to NPM
on:
push:
branches:
- master
jobs:
release:
if: "!contains(github.event.head_commit.message, 'Publish') && !contains(github.event.head_commit.message, '[SKIP-CI]') && !contains(github.event.head_commit.message, '[SKIP CI]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.ACCESS_TOKEN }}
- uses: fregante/setup-git-user@v1
- uses: actions/setup-node@v1
with:
node-version: 10
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: yarn
- name: Share PUSH_BRANCH between all steps in job
run: echo "PUSH_BRANCH=`echo "$GITHUB_REF" | awk -F / '{ print $3 }'`" >> $GITHUB_ENV
- name: Checkout to PUSH_BRANCH
run: git checkout $PUSH_BRANCH
- name: Bump version (for build and publish)
run: HUSKY_SKIP_HOOKS=1 npx lerna version --yes --conventional-commits --no-push --no-git-tag-version
- name: Commit versions (for publish)
run: |
git add .
HUSKY_SKIP_HOOKS=1 git commit -m "temp commit for publish"
- name: Build package
run: yarn build
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Publish to NPM
run: npx lerna publish from-package --yes
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Discard temp commit
run: git reset HEAD^ --hard
- name: Bump version (for github)
run: HUSKY_SKIP_HOOKS=1 npx lerna version --yes --conventional-commits --create-release github
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}