mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 04:43:54 +01:00
Update android.yml
This commit is contained in:
parent
98b25acab9
commit
bf9ab8a359
1 changed files with 37 additions and 0 deletions
37
.github/workflows/android.yml
vendored
37
.github/workflows/android.yml
vendored
|
|
@ -2,6 +2,10 @@ name: Android CI
|
|||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
permissions:
|
||||
pull-requests: write
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: build-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
|
@ -102,3 +106,36 @@ jobs:
|
|||
with:
|
||||
name: prodDebugAPK
|
||||
path: app/build/outputs/apk/prod/debug/app-*.apk
|
||||
|
||||
- name: Comment on PR with APK download links
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
const { data: { artifacts } } = await github.rest.actions.listWorkflowRunArtifacts({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
run_id: context.runId
|
||||
});
|
||||
|
||||
const betaArtifact = artifacts.find(artifact => artifact.name === "betaDebugAPK");
|
||||
const prodArtifact = artifacts.find(artifact => artifact.name === "prodDebugAPK");
|
||||
|
||||
if (betaArtifact && prodArtifact) {
|
||||
const betaDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/suites/${context.runId}/artifacts/${betaArtifact.id}`;
|
||||
const prodDownloadUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/suites/${context.runId}/artifacts/${prodArtifact.id}`;
|
||||
|
||||
const commentBody = `
|
||||
📱 **Apk for pull request is ready to see the changes** 📱
|
||||
- [Download Beta APK](${betaDownloadUrl})
|
||||
- [Download Prod APK](${prodDownloadUrl})
|
||||
`;
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
issue_number: context.issue.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: commentBody
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue