mirror of
https://github.com/StikDebug/StikDebug.git
synced 2026-10-15 20:10:30 +00:00
100 lines
3.3 KiB
YAML
100 lines
3.3 KiB
YAML
name: Build Debug IPA
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
tags: [ "[0-9]*" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
workflow_dispatch:
|
|
inputs:
|
|
create_release:
|
|
description: Create a GitHub release from this ref
|
|
required: false
|
|
default: false
|
|
type: boolean
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build:
|
|
name: Build IPA
|
|
runs-on: macos-latest
|
|
env:
|
|
UPLOAD_IPA: ${{ vars.UPLOAD_IPA || 'true' }}
|
|
|
|
steps:
|
|
- name: 1. Fetch Source Code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: 2. Configure Xcode Environment
|
|
uses: maxim-lobanov/setup-xcode@v1
|
|
with:
|
|
xcode-version: '26.6'
|
|
|
|
- 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: |
|
|
cp -R build/StikDebug.xcarchive/Products/Applications/StikDebug.app .
|
|
mkdir -p Payload
|
|
cp -R StikDebug.app Payload/
|
|
zip -r StikDebug.ipa Payload
|
|
rm -rf Payload StikDebug.app
|
|
|
|
- name: 5. Name workflow artifact
|
|
id: artifact
|
|
if: env.UPLOAD_IPA == 'true' && (github.event_name == 'push' || github.event_name == 'pull_request')
|
|
run: |
|
|
file_name="StikDebug-${GITHUB_SHA::7}.ipa"
|
|
cp StikDebug.ipa "$file_name"
|
|
echo "file_name=$file_name" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: 6. Store IPA as Workflow Artifact
|
|
if: env.UPLOAD_IPA == 'true' && (github.event_name == 'push' || github.event_name == 'pull_request')
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
path: ${{ steps.artifact.outputs.file_name }}
|
|
archive: false
|
|
retention-days: 90
|
|
|
|
- name: Read version
|
|
id: version
|
|
if: startsWith(github.ref, 'refs/tags/') || inputs.create_release
|
|
run: |
|
|
version=$(xcodebuild -project StikDebug.xcodeproj -scheme StikDebug -showBuildSettings | awk -F ' = ' '/ MARKETING_VERSION = / { print $2; exit }')
|
|
test -n "$version"
|
|
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
|
|
test "${GITHUB_REF_NAME#v}" = "$version"
|
|
fi
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Name release asset
|
|
if: startsWith(github.ref, 'refs/tags/') || inputs.create_release
|
|
run: mv StikDebug.ipa StikDebug-${{ steps.version.outputs.version }}.ipa
|
|
|
|
- name: Publish release
|
|
if: startsWith(github.ref, 'refs/tags/') || inputs.create_release
|
|
uses: softprops/action-gh-release@v3
|
|
with:
|
|
name: ${{ steps.version.outputs.version }}
|
|
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || steps.version.outputs.version }}
|
|
target_commitish: ${{ github.sha }}
|
|
files: StikDebug-${{ steps.version.outputs.version }}.ipa
|
|
generate_release_notes: true
|
|
fail_on_unmatched_files: true
|