-
Notifications
You must be signed in to change notification settings - Fork 5
68 lines (57 loc) · 2.84 KB
/
pull_request_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
name: thoth-core pull request ci
on: [pull_request]
jobs:
check-and-set-labels:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Fail thoth-core-draft
if: contains(github.event.pull_request.labels.*.name, 'thoth-core-draft')
run: exit 1
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Check for git variance in the /core directory
run: git diff --quiet origin/main origin/${{ github.head_ref }} -- packages/core
id: core_diff
shell: bash {0}
continue-on-error: true
- name: Check for an existing unique thoth-core label
if: steps.core_diff.outcome != 'success'
uses: docker://agilepathway/pull-request-label-checker:latest
id: no_thoth_core_label
with:
none_of: thoth-core
repo_token: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
- name: Label thoth-core-draft prs in queue for canary deployment
if: steps.core_diff.outcome != 'success' && steps.no_thoth_core_label.outcome != 'success' && !contains(github.event.pull_request.labels.*.name, 'thoth-core')
uses: actions-ecosystem/action-add-labels@v1
with:
labels: thoth-core-draft
continue-on-error: true
- name: Fail thoth-core-draft
if: contains(github.event.pull_request.labels.*.name, 'thoth-core-draft')
run: exit 1
- name: Label unique thoth-core pr for canary deployment
if: steps.core_diff.outcome != 'success' && steps.no_thoth_core_label.outcome == 'success'
uses: actions-ecosystem/action-add-labels@v1
with:
labels: thoth-core
continue-on-error: true
- name: Setup Node
uses: actions/setup-node@v2
if: steps.core_diff.outcome != 'success' && (steps.no_thoth_core_label.outcome == 'success' || contains(github.event.pull_request.labels.*.name, 'thoth-core'))
with:
node-version: '16.14.0'
- name: Install Dependencies
run: yarn install
if: steps.core_diff.outcome != 'success' && (steps.no_thoth_core_label.outcome == 'success' || contains(github.event.pull_request.labels.*.name, 'thoth-core'))
# - name: Publish next canary release of @thothai/thoth-core
# run: git checkout yarn.lock && yarn publish:canary
# if: steps.core_diff.outcome != 'success' && (steps.no_thoth_core_label.outcome == 'success' || contains(github.event.pull_request.labels.*.name, 'thoth-core'))
# - name: Publish next canary release of @latitudegames/thoth-core
# run: git checkout yarn.lock && yarn publish:canary
# if: steps.core_diff.outcome != 'success' && (steps.no_thoth_core_label.outcome == 'success' || contains(github.event.pull_request.labels.*.name, 'thoth-core'))