-
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (66 loc) · 1.83 KB
/
test_and_release.yaml
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
name: Test and release
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8.6.7
- uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm turbo test
release:
name: Release
runs-on: ubuntu-latest
needs: [test]
if: ${{ needs.test.result == 'success' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup SSH keys
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: github.com
- name: Setup git user
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 8.6.7
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
cache: pnpm
- name: Setup turbo cache
uses: actions/cache@v3
with:
path: '.turbo'
key: turbo-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.ref_name }}-
turbo-main-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Set NPM registry
run: npm config set //npm.pkg.github/:_authToken $NPM_TOKEN
env:
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm exec turbo build deploy