Skip to content

Commit 99c7f9f

Browse files
committed
Workflow update
1 parent c14d190 commit 99c7f9f

1 file changed

Lines changed: 35 additions & 1 deletion

File tree

.github/workflows/main.yml

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,38 @@ jobs:
7171
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
7272
github-token: ${{ secrets.GITHUB_TOKEN }}
7373
github-comment: true
74-
working-directory: Build/WebGL/WebGL
74+
working-directory: Build/WebGL/WebGL
75+
76+
deployAndroid:
77+
name: Deploy Android APK
78+
runs-on: ubuntu-latest
79+
needs: buildForAllSupportedPlatforms
80+
permissions:
81+
pull-requests: write
82+
steps:
83+
- uses: actions/checkout@v4
84+
with:
85+
fetch-depth: 0
86+
- name: Download Android Build Artifact
87+
uses: actions/download-artifact@v3
88+
with:
89+
name: Build-Android
90+
path: Build/Android
91+
- name: Generate QR Code
92+
id: generate_qr
93+
run: |
94+
apk_url=$(gh api -X GET "repos/${{ github.repository }}/actions/artifacts" | jq -r '.artifacts[] | select(.name=="Build-Android") | .archive_download_url')
95+
echo $apk_url > apk_url.txt
96+
pip install qrcode[pil]
97+
python -m qrcode --output=qr_code.png $apk_url
98+
- name: Upload QR Code
99+
uses: actions/upload-artifact@v3
100+
with:
101+
name: qr-code
102+
path: qr_code.png
103+
- name: Post Comment with APK Link and QR Code
104+
run: |
105+
apk_url=$(gh api -X GET "repos/${{ github.repository }}/actions/artifacts" | jq -r '.artifacts[] | select(.name=="Build-Android") | .archive_download_url')
106+
gh pr comment ${{ github.event.pull_request.number }} --body "APK is available for download [here](${apk_url}). ![QR Code](https://raw.githubusercontent.com/${{ github.repository }}/$(git rev-parse HEAD)/qr_code.png)"
107+
env:
108+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)