mirror of
https://github.com/xweiba/location-spoofer.git
synced 2026-09-21 22:30:46 +08:00
59 lines
1.5 KiB
YAML
59 lines
1.5 KiB
YAML
name: Build and Release IPA
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: macos-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Xcode
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: latest-stable
|
|
|
|
- name: Setup Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: '1.23'
|
|
|
|
- name: Install XcodeGen
|
|
run: brew install xcodegen
|
|
|
|
- name: Build unsigned IPA
|
|
run: ./build.sh
|
|
|
|
- name: Rename IPA for release
|
|
run: mv dist/PaopaoLocationSpoofer-unsigned.ipa dist/Location-Spoofer-unsigned.ipa
|
|
|
|
- name: Validate archived release notes
|
|
run: |
|
|
VERSION="${{ github.ref_name }}"
|
|
NOTES_FILE="docs/releases/${VERSION}.md"
|
|
if [ ! -s "$NOTES_FILE" ]; then
|
|
echo "::error::缺少版本归档 $NOTES_FILE。请在打 tag 前运行 ./Scripts/generate-release-notes.sh $VERSION 并提交。"
|
|
exit 1
|
|
fi
|
|
if ! grep -Fq "# ${VERSION}" "$NOTES_FILE"; then
|
|
echo "::error::$NOTES_FILE 的标题必须包含 # ${VERSION}"
|
|
exit 1
|
|
fi
|
|
cp "$NOTES_FILE" /tmp/release_notes.md
|
|
|
|
- name: Create Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: "${{ github.ref_name }}"
|
|
body_path: /tmp/release_notes.md
|
|
files: dist/Location-Spoofer-unsigned.ipa
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|