Skip to content

Commit

Permalink
ci: submit mapping to appcenter
Browse files Browse the repository at this point in the history
  • Loading branch information
Zxilly committed Oct 7, 2022
1 parent b8277b5 commit f22e5b1
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Build with Gradle
run: ./gradlew assembleRelease
- uses: gradle/gradle-build-action@v2
with:
arguments: assembleRelease bundlePlayRelease
env:
PASSWORD: "${{ secrets.PASSWORD }}"

Expand All @@ -43,12 +44,21 @@ jobs:
files: |
app/build/outputs/apk/github/release/*
app/build/outputs/apk/free/release/app-free-release.apk
- name: Upload artifact to App Center
uses: wzieba/AppCenter-Github-Action@v1
- name: Get apk info
id: apk-info
uses: hkusu/apk-info-action@v1
with:
appName: "zxilly/Notify"
token: ${{secrets.APP_CENTER_TOKEN}}
group: public
file: app/build/outputs/apk/appcenter/release/app-appcenter-release.apk
gitReleaseNotes: true
apk-path: app/build/outputs/apk/appcenter/release/app-appcenter-release.apk

- naem: Setup AppCenter CLI
run: |
npm install -g appcenter-cli
appcenter login --token ${{ secrets.APPCENTER_TOKEN }}
- name: Upload artifact to App Center
run: |
bash ./scripts/appcenter.sh
env:
VERSION_CODE: ${{ steps.apk-info.outputs.version-code }}
VERSION_NAME: ${{ steps.apk-info.outputs.version-name }}
16 changes: 16 additions & 0 deletions scripts/appcenter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
RELEASE_NOTES="$(git log -1 --pretty=short)"

app="zxilly/Notify"

appcenter distribute release \
--app "$app" \
--group "public" \
--file "app/build/outputs/apk/appcenter/release/app-appcenter-release.apk" \
--release-notes "$RELEASE_NOTES"

appcenter crashes upload-mappings \
--app "zxilly/Notify" \
--version-code "$VERSION_CODE" \
--version-name "$VERSION_NAME" \
--mapping "app/build/outputs/mapping/appcenterRelease/mapping.txt"

0 comments on commit f22e5b1

Please sign in to comment.