Skip to content

Commit 9acf344

Browse files
committed
update ondemand workflow to give the user a heads-up comment
1 parent 4612942 commit 9acf344

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

.github/workflows/android-debug-artifact-ondemand.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ jobs:
2929
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
3030
echo "::set-output name=repo_clone_url::${{ fromJson(steps.request.outputs.data).head.repo.clone_url }}"
3131
echo "::set-output name=repo_ssh_url::${{ fromJson(steps.request.outputs.data).head.repo.ssh_url }}"
32+
# - name: Generate temporary output
33+
# run: |
34+
# mkdir -p app/build/outputs/apk/fdroid/debug/
35+
# echo "app-fdroid-debug" >> app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk
36+
#
37+
# mkdir -p app/build/outputs/apk/play/debug/
38+
# echo "app-play-debug" >> app/build/outputs/apk/play/debug/app-play-debug.apk
3239
- name: Checkout PR Branch
3340
uses: actions/checkout@v4
3441
with:
@@ -46,17 +53,33 @@ jobs:
4653
arguments: assembleDebug --stacktrace
4754
- name: Upload fdroid artifact
4855
uses: actions/upload-artifact@v4
56+
id: artifact-upload-fdroid
4957
with:
5058
name: Amaze-Fdroid-debug
5159
path: app/build/outputs/apk/fdroid/debug/app-fdroid-debug.apk
60+
if-no-files-found: error
5261
- name: Upload play artifact
5362
uses: actions/upload-artifact@v4
63+
id: artifact-upload-play
5464
with:
5565
name: Amaze-Play-debug
5666
path: app/build/outputs/apk/play/debug/app-play-debug.apk
57-
- name: Notify the user with a comment once the APK is uploaded # TODO: update this with the link to the artifacts
67+
if-no-files-found: error
68+
- name: Get the PR number
69+
id: find-pr-id
70+
run: |
71+
PR_NUMBER=$(jq --raw-output .issue.number "$GITHUB_EVENT_PATH")
72+
73+
echo "PR_Number: $PR_NUMBER"
74+
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_OUTPUT"
75+
- name: Notify the user with a comment once the APK is uploaded
5876
uses: peter-evans/create-or-update-comment@v2
5977
with:
60-
issue-number: ${{ github.event.issue.number }}
78+
issue-number: ${{ steps.find-pr-id.outputs.PR_NUMBER }}
6179
body: |
62-
The requested APKs has been built. Please find them from the artifacts section of this PR.
80+
Requested APKs have been built. Please find them from the links below.
81+
82+
FDroid Flavour: ${{ steps.artifact-upload-fdroid.outputs.artifact-url }}
83+
Play Flavour: ${{ steps.artifact-upload-play.outputs.artifact-url }}
84+
85+
PS: you should be logged in to access the artifacts.

0 commit comments

Comments
 (0)