mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-20 04:31:09 +02:00
ci(ios): comment artifacts after pull request builds
This commit is contained in:
@@ -24,7 +24,6 @@ concurrency:
|
|||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ios-changes:
|
ios-changes:
|
||||||
@@ -103,24 +102,6 @@ jobs:
|
|||||||
if: ${{ always() && github.repository == 'bryanthaboi/gen1recomp' }}
|
if: ${{ always() && github.repository == 'bryanthaboi/gen1recomp' }}
|
||||||
run: security delete-keychain "$RUNNER_TEMP/gen1recomp-ci-signing.keychain-db" 2>/dev/null || true
|
run: security delete-keychain "$RUNNER_TEMP/gen1recomp-ci-signing.keychain-db" 2>/dev/null || true
|
||||||
|
|
||||||
ios-build-comment:
|
|
||||||
name: iOS artifact comment
|
|
||||||
needs: ios-build
|
|
||||||
if: github.event_name == 'pull_request' && github.repository == 'bryanthaboi/gen1recomp' && needs.ios-build.result == 'success'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: comment iOS artifact
|
|
||||||
uses: thollander/actions-comment-pull-request@v3
|
|
||||||
with:
|
|
||||||
message: |
|
|
||||||
#### iOS Release IPA
|
|
||||||
|
|
||||||
- [Download gen1recomp.ipa](${{ needs.ios-build.outputs.ipa_url }})
|
|
||||||
|
|
||||||
<sub>Automatically generated. [View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})</sub>
|
|
||||||
comment-tag: ios-build-result
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
headless:
|
headless:
|
||||||
name: headless suites (no ROM)
|
name: headless suites (no ROM)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
name: iOS artifact comment
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows: [ci]
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
comment:
|
||||||
|
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- id: artifact
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
RUN_ID: ${{ github.event.workflow_run.id }}
|
||||||
|
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||||
|
HEAD_REPOSITORY: ${{ github.event.workflow_run.head_repository.full_name }}
|
||||||
|
run: |
|
||||||
|
artifact_id="$(gh api "repos/$GITHUB_REPOSITORY/actions/runs/$RUN_ID/artifacts" --jq '.artifacts[] | select(.name == "gen1recomp-ios-ipa") | .id')"
|
||||||
|
[ -n "$artifact_id" ] || exit 0
|
||||||
|
head_owner="${HEAD_REPOSITORY%%/*}"
|
||||||
|
pr_number="$(gh api "repos/$GITHUB_REPOSITORY/pulls?state=open&head=$head_owner:$HEAD_BRANCH" --jq '.[0].number // empty')"
|
||||||
|
[ -n "$pr_number" ] || exit 0
|
||||||
|
echo "artifact_url=https://github.com/$GITHUB_REPOSITORY/actions/runs/$RUN_ID/artifacts/$artifact_id" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "pr_number=$pr_number" >> "$GITHUB_OUTPUT"
|
||||||
|
- name: comment iOS artifact
|
||||||
|
if: steps.artifact.outputs.pr_number != ''
|
||||||
|
uses: thollander/actions-comment-pull-request@v3
|
||||||
|
with:
|
||||||
|
message: |
|
||||||
|
#### iOS Release IPA
|
||||||
|
|
||||||
|
- [Download gen1recomp.ipa](${{ steps.artifact.outputs.artifact_url }})
|
||||||
|
|
||||||
|
<sub>Automatically generated. [View workflow run](https://github.com/${{ github.repository }}/actions/runs/${{ github.event.workflow_run.id }})</sub>
|
||||||
|
pr-number: ${{ steps.artifact.outputs.pr_number }}
|
||||||
|
comment-tag: ios-build-result
|
||||||
|
github-token: ${{ github.token }}
|
||||||
Reference in New Issue
Block a user