Skip to content

Commit

Permalink
Update job dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanwu1105 committed Dec 3, 2020
1 parent 8ab9072 commit 2debac6
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push, pull_request]
jobs:
android:
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 120

steps:
- uses: actions/checkout@v2
Expand Down
164 changes: 101 additions & 63 deletions .github/workflows/qa-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
- develop

jobs:
release:
deploy-play-store:
runs-on: ubuntu-latest
timeout-minutes: 60
timeout-minutes: 120

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -45,13 +45,6 @@ jobs:
npm run test-ci
npm run build
- name: Build Android debug APK for GitHub Release asset
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
run: |
npx cap sync android
cd android/
./gradlew assembleDebug
- name: Build Android release bundle (AAB) for Google Play Console
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
run: |
Expand Down Expand Up @@ -82,66 +75,63 @@ jobs:
releaseFiles: ./android/app/build/outputs/bundle/release/app-release.aab
track: alpha

- name: Create GitHub prerelease
id: create_release
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload-google-drive:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Extract branch name
id: extract_branch
run: echo "::set-output name=branch::${GITHUB_REF#refs/heads/}"

- uses: actions/setup-node@v1
with:
tag_name: ${{ steps.version_check.outputs.version }}
release_name: ${{ steps.version_check.outputs.version }}
body: Thanks for following along! For more information check out the [CHANGELOG](https://github.com/numbersprotocol/capture-lite/blob/develop/CHANGELOG.md).
prerelease: true
node-version: 10

- name: Upload debug APK to release assets
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check if version has been updated
id: version_check
uses: EndBug/version-check@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./android/app/build/outputs/apk/debug/app-debug.apk
asset_name: app-debug.apk
asset_content_type: application/vnd.android.package-archive
diff-search: true
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload debug metadata.json to release assets
- name: Set up JDK
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: actions/setup-java@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./android/app/build/outputs/apk/debug/output-metadata.json
asset_name: output-metadata-debug.json
asset_content_type: application/json
java-version: 1.8

- name: Send Slack notification
- name: Build Ionic
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: reminder-releases
SLACK_COLOR: '#6EE4D3'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_MESSAGE: |
Version: ${{ steps.version_check.outputs.version }}
<https://github.com/numbersprotocol/capture-lite/releases/tag/${{ steps.version_check.outputs.version }}|GitHub Release Note>
APKs
- <https://drive.google.com/drive/folders/1NH-4mruBBubxHMfXF6VXaKRCQ76Ldg_n?usp=sharing|Google Drive (debug)>
- <https://play.google.com/apps/testing/io.numbersprotocol.capturelite|Google Play Closed Alpha Testing (release)>
NUMBERS_STORAGE_BASE_URL: ${{ secrets.NUMBERS_STORAGE_BASE_URL }}
run: |
npm install -g @angular/cli
npm install -g @ionic/cli
npm install
npm run test-ci
npm run build
Notes
- name: Build APKs
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
run: |
npx cap sync android
cd android/
./gradlew assembleDebug
- Publishing process usually requires some time to complete, and thus the link provided above might still display the old version of the app. Please check the app version before download and install the app.
- This message is automatically sent from GitHub Action.
SLACK_TITLE: Capture Lite QA Release
SLACK_USERNAME: GitHub Action
- name: Upload debug outputs to Google Drive
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: satackey/action-google-drive@v1
with:
skicka-tokencache-json: ${{ secrets.SKICKA_TOKENCACHE_JSON }}
google-client-id: ${{ secrets.SKICKA_GOOGLE_CLIENT_ID }}
google-client-secret: ${{ secrets.SKICKA_GOOGLE_CLIENT_SECRET }}
upload-from: ./android/app/build/outputs/apk/debug/
upload-to: /capture-lite/apk/debug/

android-google-drive-upload:
create-github-release:
runs-on: ubuntu-latest
needs: [deploy-play-store, upload-google-drive]
steps:
- uses: actions/checkout@v2

Expand Down Expand Up @@ -184,12 +174,60 @@ jobs:
cd android/
./gradlew assembleDebug
- name: Upload debug outputs to Google Drive
- name: Create GitHub prerelease
id: create_release
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: satackey/action-google-drive@v1
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
skicka-tokencache-json: ${{ secrets.SKICKA_TOKENCACHE_JSON }}
google-client-id: ${{ secrets.SKICKA_GOOGLE_CLIENT_ID }}
google-client-secret: ${{ secrets.SKICKA_GOOGLE_CLIENT_SECRET }}
upload-from: ./android/app/build/outputs/apk/debug/
upload-to: /capture-lite/apk/debug/
tag_name: ${{ steps.version_check.outputs.version }}
release_name: ${{ steps.version_check.outputs.version }}
body: Thanks for following along! For more information check out the [CHANGELOG](https://github.com/numbersprotocol/capture-lite/blob/develop/CHANGELOG.md).
prerelease: true

- name: Upload debug APK to release assets
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./android/app/build/outputs/apk/debug/app-debug.apk
asset_name: app-debug.apk
asset_content_type: application/vnd.android.package-archive

- name: Upload debug metadata.json to release assets
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./android/app/build/outputs/apk/debug/output-metadata.json
asset_name: output-metadata-debug.json
asset_content_type: application/json

- name: Send Slack notification
if: steps.version_check.outputs.changed == 'true' && steps.extract_branch.outputs.branch == 'develop'
uses: rtCamp/action-slack-notify@master
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: reminder-releases
SLACK_COLOR: '#6EE4D3'
SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png
SLACK_MESSAGE: |
Version: ${{ steps.version_check.outputs.version }}
<https://github.com/numbersprotocol/capture-lite/releases/tag/${{ steps.version_check.outputs.version }}|GitHub Release Note>
APKs
- <https://drive.google.com/drive/folders/1NH-4mruBBubxHMfXF6VXaKRCQ76Ldg_n?usp=sharing|Google Drive (debug)>
- <https://play.google.com/apps/testing/io.numbersprotocol.capturelite|Google Play Closed Alpha Testing (release)>
Notes
- Publishing process usually requires some time to complete, and thus the link provided above might still display the old version of the app. Please check the app version before download and install the app.
- This message is automatically sent from GitHub Action.
SLACK_TITLE: Capture Lite QA Release
SLACK_USERNAME: GitHub Action

0 comments on commit 2debac6

Please sign in to comment.