Fix 3.0.0 nomap has internet permission again #471 #60
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: 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 }')" >> $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 }')" >> $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: Remove apk release suffix | |
run: find . -name "Gallery-*.apk" -exec bash -c 'mv "$1" "${1//-release/}"' _ {} \; | |
- name: Generate SHA256 | |
run: find . -name "Gallery-*.apk" -exec bash -c 'sha256sum "$1" | awk '\''{print $1}'\'' > "$1.sha256"' _ {} \; | |
- 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 | |
prerelease: true | |
tag_name: ${{ needs.build_maps.outputs.versionName }}-${{ needs.build_maps.outputs.versionCode }}-nightly | |
files: | | |
./**/Gallery-*.apk | |
./**/Gallery-*.apk.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |