-
Notifications
You must be signed in to change notification settings - Fork 205
104 lines (96 loc) · 3.06 KB
/
build.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: build
on:
push:
branches: [main, next]
pull_request:
types: [opened, synchronize, reopened]
# Enabled permissions on GITHUB_TOKEN
permissions:
# To be able to push to the repo
contents: write
# To update the pr description with canary info
pull-requests: write
# For pr-check to create a status
statuses: write
# Needed to create PR statuses/checks
checks: write
# To post comments on PRs
issues: write
jobs:
# Run install in one step so deps can be cached for other steps
install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
build:
runs-on: ubuntu-latest
needs: install
steps:
- uses: actions/checkout@v3
- name: Prepare repository
run: git fetch --unshallow --tags
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/build-cache
- run: yarn build && yarn lerna run bundle --scope=auto
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.CANARY_NPM_TOKEN }}
pr-check:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/build-cache
- uses: 8BitJonny/gh-get-current-pr@2.2.0
id: PR
- run: yarn auto pr-check --pr $PR --url "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID"
env:
PR: ${{ steps.PR.outputs.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
lint:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/build-cache
- run: yarn lint
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/build-cache
- name: Prepare repository
run: git fetch --unshallow --tags
- run: yarn test:coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Send CodeCov Results
run: bash <(curl -s https://codecov.io/bash) -t $CODECOV_KEY
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
needs: build
steps:
- uses: actions/checkout@v3
- uses: 8BitJonny/gh-get-current-pr@2.2.0
id: PR
with:
filterOutClosed: true
sha: ${{ github.event.pull_request.head.sha }}
- uses: ./.github/actions/install-deps
- uses: ./.github/actions/build-cache
- name: Prepare repository
run: git fetch --unshallow --tags
- name: Create Release
run: yarn auto shipit -vv
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ steps.PR.outputs.number && secrets.CANARY_NPM_TOKEN || secrets.NPM_TOKEN }}
PROTECTED_BRANCH_REVIEWER_TOKEN: ${{ secrets.GH_TOKEN }}
PR: ${{ steps.PR.outputs.number }}