Skip to content

Gallery: Release of 3.1.1 - 31118 #80

Gallery: Release of 3.1.1 - 31118

Gallery: Release of 3.1.1 - 31118 #80

Workflow file for this run

name: Nightly CI
on:
push:
branches:
- nightly
jobs:
build_nomaps:
runs-on: ubuntu-latest
outputs:
versionCode: ${{ steps.versioncode.outputs.versionCode }}
versionName: ${{ steps.versionname.outputs.versionName }}
steps:
- uses: actions/checkout@v4
- name: Get versionCode
id: versioncode
run: echo "versionCode=$(grep 'versionCode' app/build.gradle.kts | awk '{ print $3 }' | head -n 1)" >> $GITHUB_OUTPUT
- name: Get versionName
id: versionname
run: echo "versionName=$(grep 'versionName' app/build.gradle.kts | head -1 | awk -F\" '{ print $2 }')" >> $GITHUB_OUTPUT
- name: Strip internet permission
run: chmod +x ./strip_permission.sh && ./strip_permission.sh
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
cache: 'gradle'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'release_key.jks'
fileDir: 'app/'
encodedString: ${{ secrets.SIGNING_KEY }}
- name: Build Release APK
run: ./gradlew assembleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- uses: actions/upload-artifact@v4
with:
name: Gallery Release (No Maps)
path: app/build/**/*.apk
build_maps:
runs-on: ubuntu-latest
outputs:
versionCode: ${{ steps.versioncode.outputs.versionCode }}
versionName: ${{ steps.versionname.outputs.versionName }}
steps:
- uses: actions/checkout@v4
- name: Get versionCode
id: versioncode
run: echo "versionCode=$(grep 'versionCode' app/build.gradle.kts | awk '{ print $3 }' | head -n 1)" >> $GITHUB_OUTPUT
- name: Get versionName
id: versionname
run: echo "versionName=$(grep 'versionName' app/build.gradle.kts | head -1 | awk -F\" '{ print $2 }')" >> $GITHUB_OUTPUT
- uses: actions/setup-java@v4
with:
distribution: 'adopt'
cache: 'gradle'
java-version: 17
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Make Gradle executable
run: chmod +x ./gradlew
- name: Load Maps Token
env:
MAPS_TOKEN: $
run: echo MAPS_TOKEN=\"$MAPS_TOKEN\" > ./api.properties
- name: Decode Keystore
id: decode_keystore
uses: timheuer/base64-to-file@v1
with:
fileName: 'release_key.jks'
fileDir: 'app/'
encodedString: ${{ secrets.SIGNING_KEY }}
- name: Build Release APK
run: ./gradlew assembleRelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }}
- uses: actions/upload-artifact@v4
with:
name: Gallery Release (Maps)
path: app/build/**/*.apk
release:
needs: [build_nomaps, build_maps]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: Gallery Release (No Maps)
- uses: actions/download-artifact@v4
with:
name: Gallery Release (Maps)
- name: Generate SHA256
run: echo "### Checksums" >> ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }}-nightly-changelog.txt && find . -name "Gallery-*.apk" -type f -print0 | sort -z | xargs -r0 sha256sum | awk '{gsub(".*/", "", $2); print "**"$2"**:", "`"$1"`"} ' >> ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }}-nightly-changelog.txt
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
name: ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }} Nightly Release
body_path: ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }}-nightly-changelog.txt
prerelease: true
tag_name: ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }}-nightly
files: |
./**/Gallery-*.apk
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}