Last active
December 16, 2023 15:27
-
-
Save nirajprakash/f7159e92f5759c7ea06f0008df352ab0 to your computer and use it in GitHub Desktop.
GitHub Release for Android using Actions.
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
name: Android Build | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: | |
# - 'floss' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 1 | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
# 2 | |
- name: Generate Release APK | |
run: ./gradlew assembleFossRelease | |
# 3 | |
- name: Sign APK | |
uses: r0adkll/sign-android-release@v1 | |
# ID used to access action output | |
id: sign_app | |
with: | |
releaseDirectory: app/build/outputs/apk/foss/release | |
signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
alias: ${{ secrets.ALIAS }} | |
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
keyPassword: ${{ secrets.KEY_PASSWORD }} | |
# 4 | |
- uses: actions/upload-artifact@master | |
with: | |
name: release.apk | |
path: ${{steps.sign_app.outputs.signedReleaseFile}} | |
# 5 | |
- uses: actions/upload-artifact@master | |
with: | |
name: mapping.txt | |
path: app/build/outputs/mapping/release/mapping.txt |
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
name: Github Publish | |
on: | |
workflow_dispatch: | |
# push: | |
# branches: | |
# - 'floss' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 1 | |
- uses: dawidd6/action-download-artifact@v2 | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
workflow: build.yml | |
workflow_conclusion: success | |
branch: floss | |
name: release.apk | |
path: downloads | |
if_no_artifact_found: fail | |
# 2 | |
- name: Generate release tag | |
id: tag | |
run: | | |
echo "::set-output name=release_tag::APP_$(date +"%Y.%m.%d_%H-%M")" | |
# 3 | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: downloads/release-signed.apk |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment