-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (81 loc) · 2.46 KB
/
ci.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
78
79
80
81
82
83
84
85
86
name: CI
on:
push:
branches:
- master
paths:
- 'packages/react-drylus/**'
- 'packages/extract-emotion/**'
- 'packages/vanilla-drylus/**'
- 'packages/drylus-style-vars/**'
- 'packages/icons/**'
pull_request:
branches:
- '*'
paths:
- 'packages/react-drylus/**'
- 'packages/extract-emotion/**'
- 'packages/vanilla-drylus/**'
- 'packages/drylus-style-vars/**'
- 'packages/icons/**'
jobs:
test:
runs-on: ubuntu-18.04
if: "!contains(github.event.head_commit.message, 'skip ci')"
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
registry-url: https://npm.pkg.github.com/
scope: '@drawbotics'
- run: echo 'Current ref = ${{ github.ref }}'
- name: Install dependencies and run tests
run: |
npm run bootstrap
npx lerna link convert
npm run test
env:
NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}}
release:
needs: test
if: contains(github.ref, 'master')
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '10.x'
registry-url: https://npm.pkg.github.com/
scope: '@drawbotics'
- name: Install dependencies & build libs
run: |
npm run bootstrap
npx lerna link convert
npm run build-libs
env:
NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}}
- name: Prepare repository
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git checkout "${GITHUB_REF:11}"
git remote rm origin
git remote add origin "https://[email protected]/drawbotics/drylus.git"
git fetch origin
git branch --set-upstream-to origin/master
- name: Publish
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
MAPBOX_ACCESS_TOKEN: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.GH_TOKEN}}
if: contains(github.ref, 'master')
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.NODE_AUTH_TOKEN }}" >> ~/.npmrc
git remote -v
git checkout -- .
npm run release