-
Notifications
You must be signed in to change notification settings - Fork 189
66 lines (63 loc) · 2.26 KB
/
StagePush.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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