Skip to content

bump version number #45

bump version number

bump version number #45

name: Generated APK AAB (Upload - Create Artifact To Github Action)
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Create Secrets file
run: |
echo "Creating file with interpolated secrets"
cat <<EOF > ./app/src/main/java/com/viscouspot/gitsync/Secrets.kt
package com.viscouspot.gitsync
object Secrets {
const val GIT_CLIENT_ID = "${{ secrets.GIT_CLIENT_ID }}"
const val GIT_CLIENT_SECRET = "${{ secrets.GIT_CLIENT_SECRET }}"
}
EOF
- name: Set Up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
cache: 'gradle'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Build Release APKs
run: |
bash ./gradlew assembleBaseRelease
bash ./gradlew assembleAll-files-variantRelease
- name: Build Release Bundles
run: |
bash ./gradlew bundleBaseRelease
- name: Move files
run: |
mv app/build/outputs/apk/base/release/app-base-release-unsigned.apk app/build/outputs/app-base-release.apk
mv app/build/outputs/bundle/baseRelease/app-base-release.aab app/build/outputs/app-base-release.aab
mv app/build/outputs/apk/all-files-variant/release/app-all-files-variant-release-unsigned.apk app/build/outputs/app-all-files-variant-release.apk
- name: Sign App
id: sign_app
uses: ilharp/sign-android-release@v1
with:
releaseDir: app/build/outputs
signingKey: ${{ secrets.RELEASE_KEYSTORE_BASE64 }}
keyAlias: ${{ secrets.RELEASE_SIGNING_ALIAS }}
keyStorePassword: ${{ secrets.RELEASE_SIGNING_PASSWORD }}
keyPassword: ${{ secrets.RELEASE_SIGNING_PASSWORD }}
buildToolsVersion: 34.0.0
- name: Split
uses: jungwinter/split@v2
id: signed_files
with:
msg: ${{ steps.sign_app.outputs.signedFiles }}
separator: ':'
- name: Upload Release Build to Artifacts
uses: actions/upload-artifact@v3
with:
name: release-artifacts
path: |
${{ steps.signed_files.outputs._0 }}
${{ steps.signed_files.outputs._2 }}
- name: Build Changelog
id: changelog
uses: ardalanamini/auto-changelog@v3
with:
mention-authors: false
mention-new-contributors: false
include-compare: false
semver: false
- name: Find and Replace
uses: mad9000/actions-find-and-replace-string@5
id: signed_file_path_0
with:
source: ${{ steps.signed_files.outputs._0 }}
find: '/github/workspace/'
replace: ''
- name: Find and Replace
uses: mad9000/actions-find-and-replace-string@5
id: signed_file_path_2
with:
source: ${{ steps.signed_files.outputs._2 }}
find: '/github/workspace/'
replace: ''
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1.13.0
with:
artifacts: "${{ steps.signed_file_path_0.outputs.value }}, ${{ steps.signed_file_path_2.outputs.value }}"
body: ${{ steps.changelog.outputs.changelog }}
name: Release ${{ github.ref_name }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Playstore Release
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: com.viscouspot.gitsync
releaseName: ${{ github.ref_name }}
releaseFiles: ${{ steps.signed_files.outputs._1 }}
track: internal
status: draft