Skip to content

stage-app-push

stage-app-push #1243

Workflow file for this run

name: stage-app-push
on:
workflow_run:
workflows:
- Build
types:
- completed
jobs:
stage-default:
if: >
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: actions/checkout@v3
with:
repository: droidkaigi/conference-app-2021
ref: gh-actions
path: gh-actions
- uses: actions/github-script@v3
id: get-artifact-id
with:
result-encoding: string
script: |
const { data: resp } = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{ github.event.workflow_run.id }}
})
const artifact = resp.artifacts.find((a) => a.name === "assemble-output")
if (artifact) {
return artifact.id
} else {
return '[halt]'
}
- uses: ./gh-actions/actions/get-artifact
id: get-artifact
if: steps.get-artifact-id.outputs.result != '[halt]'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
artifact-id: ${{ steps.get-artifact-id.outputs.result }}
path: ~/assemble-output
- run: >
unzip ${{ steps.get-artifact.outputs.archive-path }} -d ~/assemble-output &&
rm -f ${{ steps.get-artifact.outputs.archive-path }}
- uses: ./gh-actions/actions/find-files
id: find-dev-debug-apk
with:
pattern: "~/assemble-output/**/app-android-dev-debug.apk"
- uses: jmatsu/[email protected]
id: upload
with:
app_owner_name: droidkaigi
api_token: ${{ secrets.DEPLOYGATE_API_TOKEN }}
app_file_path: ${{ fromJSON(steps.find-dev-debug-apk.outputs.paths)[0] }}
message: GitHub Actions have staged an artifact of ${{ github.ref }} / ${{ github.sha }}
distribution_find_by: name
distribution_id: ${{ format('staging/{0}', github.ref) }}
release_note: ${{ format('[main] Workflow {0}/{1} based on {2}', github.run_id , github.run_number , github.sha) }}
pin: false