name: Build Debug IPA on: push: branches: [ "main" ] tags: [ "[0-9]*" ] pull_request: branches: [ "main" ] workflow_dispatch: permissions: contents: write jobs: build: name: Build IPA runs-on: macos-latest outputs: version: ${{ steps.version.outputs.version }} 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' 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' 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/') 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/') run: mv StikDebug.ipa StikDebug-${{ steps.version.outputs.version }}.ipa - name: Publish release if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v3 with: name: ${{ steps.version.outputs.version }} tag_name: ${{ github.ref_name }} target_commitish: ${{ github.sha }} files: StikDebug-${{ steps.version.outputs.version }}.ipa generate_release_notes: true fail_on_unmatched_files: true update-source: name: Update website source if: startsWith(github.ref, 'refs/tags/') needs: build runs-on: ubuntu-latest steps: - name: Checkout source uses: actions/checkout@v6 - name: Checkout website uses: actions/checkout@v6 with: repository: StikDebug/Website ref: main path: Website token: ${{ secrets.WEBSITE_TOKEN }} - name: Set up Python uses: actions/setup-python@v7 with: python-version: '3.x' - name: Update StikDebug source run: .github/scripts/update_source.sh Website '${{ needs.build.outputs.version }}'