Skip to content

Status Check Workflow #46

Status Check Workflow

Status Check Workflow #46

Workflow file for this run

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_REF/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_REF/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'