-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (88 loc) · 2.49 KB
/
release.yml
File metadata and controls
97 lines (88 loc) · 2.49 KB
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
87
88
89
90
91
92
93
94
95
96
97
name: Release
on:
push:
branches:
- main
- develop
jobs:
publish:
if: |
github.event.head_commit.message &&
!startsWith(github.event.head_commit.message, 'chore(release): Release')
environment: release
timeout-minutes: 10
runs-on: ubuntu-latest
name: Publish
steps:
#
# Checkout the repository.
#
- uses: actions/checkout@v2
id: checkout
with:
token: ${{ secrets.GH_SECRET }}
#
# Wait for tests
#
- name: Wait for tests to succeed
uses: fountainhead/action-wait-for-check@v1.0.0
id: wait-for-tests
with:
token: ${{ secrets.GH_SECRET }}
checkName: Lint & Typecheck
timeoutSeconds: 1000
ref: ${{ github.event.pull_request.head.sha || github.sha }}
#
# Set git identity to be a bot
#
- name: Cache
uses: actions/cache@v2.1.6
id: cache
with:
path: |
node_modules/
.eslintcache
**/.cache
packages/**/node_modules/
key: ${{ github.ref }}-styled-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ github.ref }}-styled-
#
# Set git identity to be a bot
#
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email '42103905+github-actions[bot]@users.noreply.github.com'
env:
GITHUB_TOKEN: ${{ secrets.GH_SECRET }}
GITHUB_ACTOR: ${{ github.actor }}
#
# Setup .npmrc file to publish to npm
#
- uses: actions/setup-node@v2
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org'
token: ${{ secrets.NPM_TOKEN }}
#
# Prepare build
#
- name: Prepare build
run: yarn build --scope="@react-to-styled/build"
#
# Publish release with lerna if not already published
#
- name: Create Release
if: ${{ github.ref == 'refs/heads/main' }}
run: lerna publish --conventional-graduate --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
#
# Publish a prerelease with lerna if not already published
#
- name: Create prerelease
if: ${{ github.ref == 'refs/heads/develop' }}
run: lerna publish --yes --conventional-prerelease
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}