-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable apk distribution #152
Changes from all commits
4de567b
8627bff
79fe1a1
2383136
8c8c990
b94b3be
6f8760b
aa72e87
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: build | ||
# From now in android | ||
# https://github.com/android/nowinandroid | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths-ignore: | ||
- 'app-ios/**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
contents: read | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 60 | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- uses: ./.github/actions/setup-java | ||
|
||
- run: ./gradlew :app-android:assembleDevDebug --stacktrace | ||
|
||
- name: Upload build outputs (APKs) | ||
uses: actions/[email protected] | ||
with: | ||
name: build-outputs | ||
path: app-android/build/outputs | ||
retention-days: 14 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: drop-staging | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
# Disable all permissions. We have to enable required permissions at job-level. | ||
permissions: {} | ||
|
||
jobs: | ||
drop-stage: | ||
name: "Drop from staging" | ||
|
||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: read # for checkout | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: droidkaigi/conference-app-2024 | ||
ref: gh-actions | ||
path: gh-actions | ||
- uses: ./gh-actions/actions/destroy-distribution-by-name | ||
with: | ||
api-token: ${{ secrets.DEPLOYGATE_API_TOKEN }} | ||
app-owner-name: droidkaigi | ||
platform: android | ||
app-id: io.github.droidkaigi.confsched2024.dev | ||
distribution-name: ${{ format('debug/refs/pull/{0}/head', github.event.pull_request.number) }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: stage-app-pull-request | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- build | ||
types: | ||
- completed | ||
|
||
# Disable all permissions. We have to enable required permissions at job-level. | ||
permissions: {} | ||
|
||
jobs: | ||
stage-epic: | ||
if: > | ||
github.event.workflow_run.event == 'pull_request' && | ||
github.event.workflow_run.conclusion == 'success' | ||
|
||
permissions: | ||
actions: read # for listJobsForWorkflowRun and listWorkflowRunArtifacts | ||
contents: read # for checkout | ||
deployments: write # for create-deployment | ||
pull-requests: read # for listing pull requests | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: droidkaigi/conference-app-2024 | ||
ref: gh-actions | ||
path: gh-actions | ||
- name: Download build outputs (APKs) | ||
uses: actions/[email protected] | ||
with: | ||
name: build-outputs | ||
path: ~/build-outputs | ||
Comment on lines
+33
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used actions/download-artifact instead of ./gh-actions/actions/get-artifact, but is there any issue? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm fine with |
||
- uses: ./gh-actions/actions/find-files | ||
id: find-dev-debug-apk | ||
with: | ||
pattern: "~/build-outputs/**/app-android-dev-debug.apk" | ||
- uses: ./gh-actions/actions/create-deployment | ||
id: create-deployment | ||
with: | ||
github-token: ${{ github.token }} | ||
ref: refs/pull/${{ fromJSON(steps.get-pr.outputs.result).number }}/head | ||
sha: ${{ fromJSON(steps.get-pr.outputs.result).head.sha }} | ||
artifact-name: build-outputs | ||
environment: deploygate-distribution | ||
- uses: jmatsu/[email protected] | ||
id: upload | ||
continue-on-error: true | ||
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 ${{ fromJSON(steps.get-pr.outputs.result).number }}/head / ${{ fromJSON(steps.get-pr.outputs.result).head.sha }} | ||
distribution_find_by: name | ||
distribution_id: ${{ format('debug/refs/pull/{0}/head', fromJSON(steps.get-pr.outputs.result).number) }} | ||
release_note: ${{ format('Workflow {0}/{1} based on {2}', github.run_id , github.run_number , fromJSON(steps.get-pr.outputs.result).head.sha) }} | ||
pin: false | ||
- name: generate properties based on upload step's status | ||
id: deployment-properties | ||
if: steps.upload.conclusion == 'success' | ||
run: | | ||
if [[ "${{ steps.upload.outcome }}" == "success" ]]; then | ||
echo "deployment-url=${{ steps.upload.outputs.distribution_url }}" >> "$GITHUB_OUTPUT" | ||
echo "description=Deployed an app successfully. Please try it through DeployGate!" >> "$GITHUB_OUTPUT" | ||
else | ||
echo "deployment-url=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" >> "$GITHUB_OUTPUT" | ||
echo "description=Staging an app failed. Please check the workflow." >> "$GITHUB_OUTPUT" | ||
fi | ||
- uses: ./gh-actions/actions/commit-deployment | ||
if: steps.upload.conclusion == 'success' | ||
with: | ||
github-token: ${{ github.token }} | ||
deployment-id: ${{ fromJSON(steps.create-deployment.outputs.deployment).id }} | ||
state: ${{ steps.upload.outcome }} | ||
deployment-url: ${{ steps.deployment-properties.outputs.deployment-url }} | ||
description: ${{ steps.deployment-properties.outputs.description }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: stage-app-push | ||
|
||
on: | ||
workflow_run: | ||
workflows: | ||
- build | ||
types: | ||
- completed | ||
|
||
# Disable all permissions. We have to enable required permissions at job-level. | ||
permissions: {} | ||
|
||
jobs: | ||
stage-default: | ||
if: > | ||
github.event.workflow_run.event == 'push' && | ||
github.event.workflow_run.conclusion == 'success' | ||
|
||
permissions: | ||
actions: read # for listing workflow run artifacts | ||
contents: read # for checkout | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
repository: droidkaigi/conference-app-2024 | ||
ref: gh-actions | ||
path: gh-actions | ||
- name: Download build outputs (APKs) | ||
uses: actions/[email protected] | ||
with: | ||
name: build-outputs | ||
path: ~/build-outputs | ||
- uses: ./gh-actions/actions/find-files | ||
id: find-dev-debug-apk | ||
with: | ||
pattern: "~/build-outputs/**/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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some usefull workflows in another branch. These workflows were created by jmatsu and modified by tomoya0x00.
https://github.com/DroidKaigi/conference-app-2024/tree/gh-actions
I updated dependencies and switched to using Node 20.