diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 7081fc4..8fce468 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -52,7 +52,10 @@ jobs: - name: Get apk path id: apk-path run: echo "path=$(find . -regex '^.*/build/outputs/apk/fdroid/release/.*\.apk$' -type f | head -1)" >> $GITHUB_OUTPUT - + - name: Get version code + run: | + version_code=$(grep "VERSION_CODE" buildSrc/src/main/kotlin/Constants.kt | awk '{print $2}' | tr -d '\n') + echo "VERSION_CODE=$version_code" >> $GITHUB_ENV # Save the APK after the Build job is complete to publish it as a Github release in the next job - name: Upload APK uses: actions/upload-artifact@v4.2.0 @@ -70,7 +73,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # fix hardcode changelog file name - body_path: ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/33400.txt + body_path: ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 73fc619..84777a1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,7 +52,10 @@ jobs: - name: Get apk path id: apk-path run: echo "path=$(find . -regex '^.*/build/outputs/apk/fdroid/release/.*\.apk$' -type f | head -1)" >> $GITHUB_OUTPUT - + - name: Get version code + run: | + version_code=$(grep "VERSION_CODE" buildSrc/src/main/kotlin/Constants.kt | awk '{print $2}' | tr -d '\n') + echo "VERSION_CODE=$version_code" >> $GITHUB_ENV # Save the APK after the Build job is complete to publish it as a Github release in the next job - name: Upload APK uses: actions/upload-artifact@v4.2.0 @@ -76,7 +79,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: # fix hardcode changelog file name - body_path: ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/33400.txt + body_path: ${{ github.workspace }}/fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt tag_name: ${{ github.ref_name }} name: ${{ github.ref_name }} draft: false diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index ee8e622..6f025b2 100644 --- a/buildSrc/src/main/kotlin/Constants.kt +++ b/buildSrc/src/main/kotlin/Constants.kt @@ -1,7 +1,7 @@ object Constants { - const val VERSION_NAME = "3.3.4" + const val VERSION_NAME = "3.3.4-test1" const val JVM_TARGET = "17" - const val VERSION_CODE = 33400 + const val VERSION_CODE = 33401 const val TARGET_SDK = 34 const val MIN_SDK = 26 const val APP_ID = "com.zaneschepke.wireguardautotunnel" diff --git a/fastlane/metadata/android/en-US/changelogs/33401.txt b/fastlane/metadata/android/en-US/changelogs/33401.txt new file mode 100644 index 0000000..044f144 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/33401.txt @@ -0,0 +1,2 @@ +What's new: +- This is a CI testing version \ No newline at end of file