mirror of
https://github.com/ARMSX2/Armsx2-Repo.git
synced 2026-08-24 16:52:58 -07:00
78 lines
2.0 KiB
YAML
78 lines
2.0 KiB
YAML
name: Update Source
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
include_prereleases:
|
|
description: "Include prerelease upstream releases"
|
|
required: false
|
|
default: "false"
|
|
type: choice
|
|
options:
|
|
- "false"
|
|
- "true"
|
|
schedule:
|
|
- cron: "17 */6 * * *"
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
concurrency:
|
|
group: update-source
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
update-source:
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
ARMSX2_PUBLIC_BASE_URL: https://ios.armsx2.net
|
|
INCLUDE_PRERELEASES: ${{ inputs.include_prereleases || 'false' }}
|
|
|
|
steps:
|
|
- name: Check out repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
token: ${{ secrets.SOURCE_UPDATE_TOKEN || secrets.GITHUB_TOKEN }}
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "22"
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Sync latest upstream IPA
|
|
id: sync
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: npm run sync:upstream
|
|
|
|
- name: Regenerate source files
|
|
if: steps.sync.outputs.changed == 'true'
|
|
run: npm run generate:source
|
|
|
|
- name: Validate generated source
|
|
if: steps.sync.outputs.changed == 'true'
|
|
run: |
|
|
npm run check:source
|
|
npm run validate:source
|
|
|
|
- name: Commit and push update
|
|
if: steps.sync.outputs.changed == 'true'
|
|
run: |
|
|
if git diff --quiet --exit-code; then
|
|
echo "No generated changes to commit."
|
|
exit 0
|
|
fi
|
|
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
|
|
git add apps.json checksums.json public/ ipas/ assets/ index.html
|
|
git commit -m "Update ARMSX2 iOS source: ${{ steps.sync.outputs.version }}"
|
|
git push origin HEAD:${{ github.ref_name }}
|