-
Notifications
You must be signed in to change notification settings - Fork 17
77 lines (65 loc) · 2.04 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
on:
pull_request:
branches:
- master
- development
jobs:
build-and-publish:
name: Build Jopi & Publish New Version in NPM
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
#- name: Configure git credentials
# uses: OleksiyRudenko/gha-git-credentials@v2-latest
# with:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Installing node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Installing yarn
run: |
yarn install
# - name: Set Current Version
# run: |
# CURRENT_VERSION=$(node -p 'require("./lerna.json").version')
# echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV
- name: Run tests
run: yarn test
- name: Run coverage
run: yarn jest --coverage
- name: Build Jopi
run: yarn build
- name: Set Git config
run: |
git config --global user.email "${{secrets.GIT_EMAIL}}"
git config --global user.name "${{secrets.GIT_USER}}"
- name: Update lerna packages
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd node_modules/.bin
lerna version patch --yes
- name: Publish New Jopi version to NPM
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx lerna publish from-package --yes
merge-me:
name: Merge to master
needs:
- build-and-publish
runs-on: ubuntu-latest
steps:
- name: Merge me!
uses: ridedott/merge-me-action@master
with:
# This must be used as GitHub Actions token does not support
# pushing to protected branches.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}