From 22e34051fffb49727d146553ed3c9d0756c632bc Mon Sep 17 00:00:00 2001 From: CelloSerenity <195480169+CelloSerenity@users.noreply.github.com> Date: Sat, 1 Aug 2026 09:24:12 -0600 Subject: [PATCH] Publish IPA releases from tags --- .github/workflows/build_ipa.yml | 47 +++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_ipa.yml b/.github/workflows/build_ipa.yml index 806dbce..323c3a8 100644 --- a/.github/workflows/build_ipa.yml +++ b/.github/workflows/build_ipa.yml @@ -3,12 +3,19 @@ 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: read + contents: write jobs: build: @@ -50,10 +57,40 @@ jobs: zip -r StikDebug.ipa Payload rm -rf Payload StikDebug.app - - name: 5. Store IPA as Workflow Artifact - if: env.UPLOAD_IPA == 'true' + - name: 5. Name workflow artifact + if: env.UPLOAD_IPA == 'true' && (github.event_name == 'push' || github.event_name == 'pull_request') + run: cp StikDebug.ipa StikDebug-${{ github.sha }}.ipa + + - 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: - name: StikDebug-Debug.ipa - path: StikDebug.ipa + path: StikDebug-${{ github.sha }}.ipa + 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@v2 + with: + name: StikDebug ${{ 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