-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from DroidKaigi/yamada-ika/fix-distribute-apk…
…-bug use gh-actions scripts instead of actions/download-artifact to download artifacts
- Loading branch information
Showing
3 changed files
with
49 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,11 +30,55 @@ jobs: | |
repository: droidkaigi/conference-app-2024 | ||
ref: gh-actions | ||
path: gh-actions | ||
- name: Download build outputs (APKs) | ||
uses: actions/[email protected] | ||
- uses: actions/[email protected] | ||
id: get-pr | ||
with: | ||
name: build-outputs | ||
script: | | ||
const headBranch = '${{ format('{0}:{1}', github.event.workflow_run.head_repository.owner.login, github.event.workflow_run.head_branch) }}' | ||
const { data: pulls } = await github.rest.pulls.list({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
state: 'open', | ||
head: headBranch, | ||
direction: 'desc', | ||
sort: 'updated', | ||
per_page: 1 | ||
}) | ||
if (pulls.length === 0) { | ||
return '[halt]' | ||
} else { | ||
return pulls[0] | ||
} | ||
- uses: actions/[email protected] | ||
id: get-artifact-id | ||
if: steps.get-pr.outputs.result != '[halt]' | ||
with: | ||
result-encoding: string | ||
script: | | ||
const { data: resp } = await github.rest.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 === "build-outputs") | ||
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: ~/build-outputs | ||
- run: > | ||
unzip ${{ steps.get-artifact.outputs.archive-path }} -d ~/build-outputs && | ||
rm -f ${{ steps.get-artifact.outputs.archive-path }} | ||
- uses: ./gh-actions/actions/find-files | ||
id: find-dev-debug-apk | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters