-
Notifications
You must be signed in to change notification settings - Fork 12
72 lines (62 loc) · 2.12 KB
/
status-check.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
name: Status Check Workflow
on:
workflow_dispatch:
inputs:
psha:
required: true
jobs:
build:
name: Check Build
runs-on: macos-13
permissions:
checks: write
statuses: write
env:
FIN_STATUS: "error"
GH_TOKEN: ${{ github.token }}
steps:
- name: Update Check Status
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/$GITHUB_SHA \
-f state='pending' \
-f target_url='https://github.com/Darock-Studio/Darock-Bili/actions/runs/${{ github.run_id }}' \
-f description='Building...' \
-f context='API Status Checker'
- name: Checkout
uses: actions/checkout@v3
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Cache Build Caches
uses: actions/cache@v3
with:
key: check-build-cache
path: |
~/Library/Developer/Xcode/DerivedData
- name: Cache Package Caches
uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Update Status Env
run: echo "FIN_STATUS=failure" >> $GITHUB_ENV
- name: Build DarockBili App
run: |
xcodebuild -scheme 'DarockBili Watch App' -configuration Release build CODE_SIGN_IDENTITY=""
echo "FIN_STATUS=success" >> $GITHUB_ENV
- name: Update Check Status
if: always()
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/repos/${{ github.repository }}/statuses/$GITHUB_SHA \
-f state='$FIN_STATUS' \
-f target_url='https://github.com/Darock-Studio/Darock-Bili/actions/runs/${{ github.run_id }}' \
-f context='API Status Checker'