Skip to content

Status Check Workflow #76

Status Check Workflow

Status Check Workflow #76

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.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
with:
ref: ${{ inputs.psha }}
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_15.0.app
- name: Get Current Time
id: current-time
run: echo "time=$(date +"%Y%m%d%H%M%S")" >> $GITHUB_OUTPUT
- name: Cache Build Caches
uses: actions/cache@v3
with:
key: ${{ runner.os }}-check-build-cache-${{ steps.current-time.outputs.time }}
path: |
~/Library/Developer/Xcode/DerivedData
restore-keys: |
${{ runner.os }}-check-build-cache-
- 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="" -quiet
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='${{ env.FIN_STATUS }}' \
-f target_url='https://github.com/Darock-Studio/Darock-Bili/actions/runs/${{ github.run_id }}' \
-f context='API Status Checker'