feat: add release workflow, remove unused updatesource

This commit is contained in:
lijingjun 2026-05-30 09:38:15 +08:00
parent 9c7c1aa7ac
commit 5f2ed6667b
2 changed files with 65 additions and 104 deletions

65
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,65 @@
name: Release IPA
on:
push:
tags:
- 'v*'
permissions:
contents: write
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
release:
name: Build & Release IPA
runs-on: macos-latest
steps:
- name: 1. Fetch Source Code
uses: actions/checkout@v4
- name: 2. Configure Xcode Environment
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '26.0.1'
- name: 3. Compile Project Archive
run: |
xcodebuild clean archive \
-project StikDebug.xcodeproj \
-scheme "StikDebug" \
-configuration Debug \
-archivePath build/StikDebug.xcarchive \
-sdk iphoneos \
-destination 'generic/platform=iOS' \
ONLY_ACTIVE_ARCH=NO \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
SWIFT_OPTIMIZATION_LEVEL="-Onone" \
IPHONEOS_DEPLOYMENT_TARGET=17.4
- name: 4. Package .app into .ipa
run: |
VERSION=${GITHUB_REF#refs/tags/v}
IPA_NAME="StikDebug-${VERSION}.ipa"
cp -R build/StikDebug.xcarchive/Products/Applications/StikDebug.app .
mkdir -p Payload
cp -R StikDebug.app Payload/
zip -r "${IPA_NAME}" Payload
rm -rf Payload StikDebug.app
echo "IPA_NAME=${IPA_NAME}" >> $GITHUB_ENV
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: 5. Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: "StikDebug v${{ env.VERSION }}"
prerelease: false
files: |
${{ env.IPA_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,104 +0,0 @@
name: Update StikJIT Source
on:
release:
types: [published]
workflow_dispatch:
# Add permissions block to ensure the workflow can push changes
permissions:
contents: write
jobs:
update-source:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
repository: 0-Blu/StikJIT
ref: main
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests
- name: Record job start time
id: job_start_time
run: echo "start_time=$(date +%s)" >> $GITHUB_OUTPUT
- name: Debug repository information
run: |
echo "Repository: 0-Blu/StikJIT"
echo "Event name: $GITHUB_EVENT_NAME"
echo "Current directory: $(pwd)"
echo "Repository contents:"
ls -la
- name: Update StikJIT source
id: update_source
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Configure git
git config --global user.name 'GitHub Action'
git config --global user.email 'action@github.com'
# Run the update script
python update_json.py
# Check for changes and commit if needed
git add repo.json
if git diff --staged --quiet; then
echo "changes=false" >> $GITHUB_OUTPUT
echo "No changes detected in repo.json"
else
echo "Changes detected in repo.json:"
git diff --staged
git commit -m "Updated source with latest StikJIT release"
# Push to main branch of original repository
git push origin main
echo "changes=true" >> $GITHUB_OUTPUT
fi
- name: Calculate job duration
id: duration
if: always()
run: |
end_time=$(date +%s)
duration=$((end_time - ${{ steps.job_start_time.outputs.start_time }}))
echo "duration=$duration seconds" >> $GITHUB_OUTPUT
- name: Create job summary
run: |
if [[ "${{ steps.update_source.outputs.changes }}" == "true" ]]; then
echo "## Update StikJIT Source Summary 🚀" >> $GITHUB_STEP_SUMMARY
echo "✅ Changes Detected and Pushed" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The repo.json file has been updated with the latest release information." >> $GITHUB_STEP_SUMMARY
else
echo "## Update StikJIT Source Summary 🚀" >> $GITHUB_STEP_SUMMARY
echo "🔍 No Changes Detected" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The repo.json file is up to date. No changes were necessary." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "This could be because:" >> $GITHUB_STEP_SUMMARY
echo "- The release version is already in the repo.json file" >> $GITHUB_STEP_SUMMARY
echo "- The release doesn't contain an IPA file" >> $GITHUB_STEP_SUMMARY
echo "- The release tag doesn't match the expected version format" >> $GITHUB_STEP_SUMMARY
fi
echo "" >> $GITHUB_STEP_SUMMARY
echo "🕐 Execution Time" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "This job took ${{ steps.duration.outputs.duration }} to complete." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "📆 Next Scheduled Run" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The next scheduled run will be triggered when a new release is published." >> $GITHUB_STEP_SUMMARY