diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..6be9a3e6 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,15 @@ +# These are supported funding model platforms + +github: ethran # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: rethran +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +polar: # Replace with a single Polar username +buy_me_a_coffee: # Replace with a single Buy Me a Coffee username +thanks_dev: # Replace with a single thanks.dev username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 98493af0..9fc952ed 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -1,8 +1,10 @@ name: Build and Release Preview - on: push: - branches: ["main"] + branches: ["dev"] + paths: + - 'app/**' + workflow_dispatch: env: MAVEN_OPTS: >- @@ -23,7 +25,7 @@ jobs: - uses: gradle/gradle-build-action@v2 with: - gradle-version: 7.5 + gradle-version: 8.5 - name: Decode Keystore id: decode_keystore @@ -33,15 +35,28 @@ jobs: fileName: "my.keystore" encodedString: ${{ secrets.KEYSTORE_FILE }} + - name: Remove `google-services.json` + run: rm ${{ github.workspace }}/app/google-services.json + + - name: Decode and Replace `google-services.json` + env: + FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} + run: | + echo $FIREBASE_CONFIG | base64 --decode > ${{ github.workspace }}/app/google-services.json + wc -l ${{ github.workspace }}/app/google-services.json + - name: Execute Gradle build run: | + export STORE_FILE="../${{ steps.decode_keystore.outputs.filePath }}" + export STORE_PASSWORD="${{ secrets.KEYSTORE_PASSWORD }}" + export KEY_ALIAS="${{ secrets.KEY_ALIAS }}" + export KEY_PASSWORD="${{ secrets.KEY_PASSWORD }}" + export SHIPBOOK_APP_ID="${{ secrets.SHIPBOOK_APP_ID }}" + export SHIPBOOK_APP_KEY="${{ secrets.SHIPBOOK_APP_KEY }}" + ./gradlew \ - -PDEBUG_STORE_FILE="../${{ steps.decode_keystore.outputs.filePath }}" \ - -PDEBUG_STORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \ - -PDEBUG_KEY_ALIAS=${{ secrets.KEY_ALIAS }} \ - -PDEBUG_KEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \ - -PIS_NEXT=true \ - assembleDebug + -PIS_NEXT=true \ + assembleDebug # - name: Cache Gradle packages # uses: actions/cache@v1 @@ -59,5 +74,5 @@ jobs: tag_name: next name: next prerelease: true - body: "Preview version corresponding to the latest build on main" + body: "Preview version built from branch: ${{ github.ref_name }}" token: ${{ secrets.TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d85230a0..e0b5f539 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,7 @@ name: Build and Release Version on: - push: - branches: ["release"] + workflow_dispatch: env: MAVEN_OPTS: >- @@ -23,7 +22,7 @@ jobs: - uses: gradle/gradle-build-action@v2 with: - gradle-version: 7.5 + gradle-version: 8.5 - name: Decode Keystore id: decode_keystore @@ -33,14 +32,28 @@ jobs: fileName: "my.keystore" encodedString: ${{ secrets.KEYSTORE_FILE }} + - name: Decode and Replace `google-services.json` + env: + FIREBASE_CONFIG: ${{ secrets.FIREBASE_CONFIG }} + run: | + echo $FIREBASE_CONFIG | base64 --decode > ${{ github.workspace }}/app/google-services.json + - name: Execute Gradle build + env: + STORE_FILE: ${{ github.workspace }}/secrets/my.keystore + STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} + SHIPBOOK_APP_ID: ${{ secrets.SHIPBOOK_APP_ID }} + SHIPBOOK_APP_KEY: ${{ secrets.SHIPBOOK_APP_KEY }} run: | - ./gradlew \ - -PDEBUG_STORE_FILE="../${{ steps.decode_keystore.outputs.filePath }}" \ - -PDEBUG_STORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \ - -PDEBUG_KEY_ALIAS=${{ secrets.KEY_ALIAS }} \ - -PDEBUG_KEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \ - assembleDebug + ./gradlew assembleRelease \ + -PSTORE_FILE="$STORE_FILE" \ + -PSTORE_PASSWORD="$STORE_PASSWORD" \ + -PKEY_ALIAS="$KEY_ALIAS" \ + -PKEY_PASSWORD="$KEY_PASSWORD" + + # - name: Cache Gradle packages # uses: actions/cache@v1 @@ -49,25 +62,30 @@ jobs: # key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} # restore-keys: ${{ runner.os }}-gradle + - name: Verify APK Files + run: find ${{ github.workspace }}/app/build/outputs/apk/ -name "*.apk" + - name: Retrieve Version + env: + STORE_FILE: ${{ github.workspace }}/secrets/my.keystore + STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.RELEASE_KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }} + SHIPBOOK_APP_ID: ${{ secrets.SHIPBOOK_APP_ID }} + SHIPBOOK_APP_KEY: ${{ secrets.SHIPBOOK_APP_KEY }} run: | - echo "::set-output name=VERSION_NAME::$(${{github.workspace}}/gradlew \ - -PDEBUG_STORE_FILE="../${{ steps.decode_keystore.outputs.filePath }}" \ - -PDEBUG_STORE_PASSWORD=${{ secrets.KEYSTORE_PASSWORD }} \ - -PDEBUG_KEY_ALIAS=${{ secrets.KEY_ALIAS }} \ - -PDEBUG_KEY_PASSWORD=${{ secrets.KEY_PASSWORD }} \ - -q printVersionName)" + ./gradlew -q printVersionName + VERSION_NAME=$(./gradlew -q printVersionName) + echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV id: android_version - - name: Get version - run: | - echo "version_name=${{steps.android_version.outputs.VERSION_NAME}}" >> $GITHUB_ENV - - run: mv ${{ github.workspace }}/app/build/outputs/apk/debug/app-debug.apk ${{ github.workspace }}/app/build/outputs/apk/debug/notable-${{ env.version_name }}.apk + - name: Rename APK + run: mv ${{ github.workspace }}/app/build/outputs/apk/release/app-release.apk ${{ github.workspace }}/app/build/outputs/apk/release/notable-${{ env.VERSION_NAME }}.apk - name: Release uses: softprops/action-gh-release@v1 with: - files: ${{ github.workspace }}/app/build/outputs/apk/debug/notable-${{ env.version_name }}.apk - tag_name: v${{env.version_name}} + files: ${{ github.workspace }}/app/build/outputs/apk/release/notable-${{ env.VERSION_NAME }}.apk + tag_name: v${{env.VERSION_NAME}} token: ${{ secrets.TOKEN }} diff --git a/.idea/AndroidProjectSystem.xml b/.idea/AndroidProjectSystem.xml new file mode 100644 index 00000000..4a53bee8 --- /dev/null +++ b/.idea/AndroidProjectSystem.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index fb7f4a8a..b86273d9 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/deploymentTargetSelector.xml b/.idea/deploymentTargetSelector.xml new file mode 100644 index 00000000..b268ef36 --- /dev/null +++ b/.idea/deploymentTargetSelector.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index a2d7c213..639c779c 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,9 +4,9 @@