A cross platform Audiobookshelf client for Android and iOS
Dart
Add a pre-release option to the release workflows
Barnabas855f82f34428
diff --git a/.github/workflows/all-release.yml b/.github/workflows/all-release.ymlindex 06f4f0cf..ab9951ac 100644--- a/.github/workflows/all-release.yml+++ b/.github/workflows/all-release.yml@@ -13,6 +13,11 @@ name: All Platforms Releaseon:workflow_dispatch:inputs:+ prerelease:+ description: "Pre-release? Uploads to v<version>-pre, marks it prerelease, adds -pre to the filenames"+ required: false+ type: boolean+ default: falsebeta_test_notes:description: "What to Test (TestFlight notes, optional)"required: false@@ -66,11 +71,23 @@ jobs:- name: Read pubspec versionid: version+ env:+ PRE: ${{ inputs.prerelease }}run: |RAW=$(grep '^version:' pubspec.yaml | sed 's/version: *//')VERSION_NAME="${RAW%%+*}"+ # Unified artifact basename: dash (URL-safe, unlike +) between version+ # and build number, plus a -pre suffix for prereleases.+ BASE="absorb-${RAW//+/-}"+ if [ "$PRE" = "true" ]; then+ echo "tag=v${VERSION_NAME}-pre" >> "$GITHUB_OUTPUT"+ echo "fname=${BASE}-pre" >> "$GITHUB_OUTPUT"+ else+ echo "tag=v${VERSION_NAME}" >> "$GITHUB_OUTPUT"+ echo "fname=${BASE}" >> "$GITHUB_OUTPUT"+ fiecho "raw=$RAW" >> "$GITHUB_OUTPUT"- echo "tag=v$VERSION_NAME" >> "$GITHUB_OUTPUT"+ echo "pre=$PRE" >> "$GITHUB_OUTPUT"- name: Notify Discord (build started)if: env.DISCORD_WEBHOOK_URL != ''@@ -148,24 +165,25 @@ jobs:- name: Build iOS IPArun: flutter build ipa --release --export-options-plist=$HOME/export_options.plist- - name: Rename APK, AAB and IPA with version+ - name: Rename APK, AAB and IPAenv:- RAW: ${{ steps.version.outputs.raw }}+ FNAME: ${{ steps.version.outputs.fname }}run: |# gradle already names the APK absorb-<version>-<code>.apk, so skip# the mv when source and destination are the same file.APK_SRC=$(ls build/app/outputs/apk/github/release/*.apk | head -1)- APK_DST="build/app/outputs/apk/github/release/absorb-${RAW//+/-}.apk"+ APK_DST="build/app/outputs/apk/github/release/${FNAME}.apk"[ "$APK_SRC" = "$APK_DST" ] || mv "$APK_SRC" "$APK_DST"AAB_SRC=$(ls build/app/outputs/bundle/playstoreRelease/*.aab | head -1)- mv "$AAB_SRC" "build/app/outputs/bundle/playstoreRelease/absorb-${RAW}.aab"+ mv "$AAB_SRC" "build/app/outputs/bundle/playstoreRelease/${FNAME}.aab"IPA_SRC=$(ls build/ios/ipa/*.ipa | head -1)- mv "$IPA_SRC" "build/ios/ipa/absorb-${RAW}.ipa"+ mv "$IPA_SRC" "build/ios/ipa/${FNAME}.ipa"- name: Upload all to GitHub draft releaseenv:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}VERSION_TAG: ${{ steps.version.outputs.tag }}+ PRE: ${{ steps.version.outputs.pre }}run: |if gh release view "$VERSION_TAG" &>/dev/null; thengh release upload "$VERSION_TAG" \@@ -174,12 +192,13 @@ jobs:build/ios/ipa/*.ipa \--clobberelse+ CREATE_ARGS=(--draft --title "$VERSION_TAG")+ [ "$PRE" = "true" ] && CREATE_ARGS+=(--prerelease)gh release create "$VERSION_TAG" \build/app/outputs/apk/github/release/*.apk \build/app/outputs/bundle/playstoreRelease/*.aab \build/ios/ipa/*.ipa \- --draft \- --title "$VERSION_TAG"+ "${CREATE_ARGS[@]}"fi# Upload the AAB to Play Console as a DRAFT on the internal track. It justdiff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.ymlindex 632cd726..f1275899 100644--- a/.github/workflows/android-release.yml+++ b/.github/workflows/android-release.yml@@ -11,6 +11,12 @@ name: Android Releaseon:workflow_dispatch:+ inputs:+ prerelease:+ description: "Pre-release? Uploads to v<version>-pre, marks it prerelease, adds -pre to the filenames"+ required: false+ type: boolean+ default: falsejobs:build:@@ -37,11 +43,23 @@ jobs:- name: Read pubspec versionid: version+ env:+ PRE: ${{ inputs.prerelease }}run: |RAW=$(grep '^version:' pubspec.yaml | sed 's/version: *//')VERSION_NAME="${RAW%%+*}"+ # Unified artifact basename: dash (URL-safe, unlike +) between version+ # and build number, plus a -pre suffix for prereleases.+ BASE="absorb-${RAW//+/-}"+ if [ "$PRE" = "true" ]; then+ echo "tag=v${VERSION_NAME}-pre" >> "$GITHUB_OUTPUT"+ echo "fname=${BASE}-pre" >> "$GITHUB_OUTPUT"+ else+ echo "tag=v${VERSION_NAME}" >> "$GITHUB_OUTPUT"+ echo "fname=${BASE}" >> "$GITHUB_OUTPUT"+ fiecho "raw=$RAW" >> "$GITHUB_OUTPUT"- echo "tag=v$VERSION_NAME" >> "$GITHUB_OUTPUT"+ echo "pre=$PRE" >> "$GITHUB_OUTPUT"- name: Notify Discord (build started)if: env.DISCORD_WEBHOOK_URL != ''@@ -76,22 +94,23 @@ jobs:- name: Build Play Store AABrun: flutter build appbundle --release --flavor playstore --dart-define=PLAYSTORE_BUILD=true- - name: Rename APK and AAB with version+ - name: Rename APK and AABenv:- RAW: ${{ steps.version.outputs.raw }}+ FNAME: ${{ steps.version.outputs.fname }}run: |# gradle already names the APK absorb-<version>-<code>.apk, so skip# the mv when source and destination are the same file.APK_SRC=$(ls build/app/outputs/apk/github/release/*.apk | head -1)- APK_DST="build/app/outputs/apk/github/release/absorb-${RAW//+/-}.apk"+ APK_DST="build/app/outputs/apk/github/release/${FNAME}.apk"[ "$APK_SRC" = "$APK_DST" ] || mv "$APK_SRC" "$APK_DST"AAB_SRC=$(ls build/app/outputs/bundle/playstoreRelease/*.aab | head -1)- mv "$AAB_SRC" "build/app/outputs/bundle/playstoreRelease/absorb-${RAW}.aab"+ mv "$AAB_SRC" "build/app/outputs/bundle/playstoreRelease/${FNAME}.aab"- name: Upload APK + AAB to GitHub draft releaseenv:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}VERSION_TAG: ${{ steps.version.outputs.tag }}+ PRE: ${{ steps.version.outputs.pre }}run: |if gh release view "$VERSION_TAG" &>/dev/null; thengh release upload "$VERSION_TAG" \@@ -99,11 +118,12 @@ jobs:build/app/outputs/bundle/playstoreRelease/*.aab \--clobberelse+ CREATE_ARGS=(--draft --title "$VERSION_TAG")+ [ "$PRE" = "true" ] && CREATE_ARGS+=(--prerelease)gh release create "$VERSION_TAG" \build/app/outputs/apk/github/release/*.apk \build/app/outputs/bundle/playstoreRelease/*.aab \- --draft \- --title "$VERSION_TAG"+ "${CREATE_ARGS[@]}"fi- name: Notify Discord (build finished)diff --git a/.github/workflows/ios-release.yml b/.github/workflows/ios-release.ymlindex 09f3b953..deff1657 100644--- a/.github/workflows/ios-release.yml+++ b/.github/workflows/ios-release.yml@@ -8,6 +8,11 @@ name: iOS Releaseon:workflow_dispatch:inputs:+ prerelease:+ description: "Pre-release? Uploads to v<version>-pre, marks it prerelease, adds -pre to the filename"+ required: false+ type: boolean+ default: falsebeta_test_notes:description: "What to Test (TestFlight notes, optional)"required: false@@ -54,11 +59,23 @@ jobs:- name: Read pubspec versionid: version+ env:+ PRE: ${{ inputs.prerelease }}run: |RAW=$(grep '^version:' pubspec.yaml | sed 's/version: *//')VERSION_NAME="${RAW%%+*}"+ # Unified artifact basename: dash (URL-safe, unlike +) between version+ # and build number, plus a -pre suffix for prereleases.+ BASE="absorb-${RAW//+/-}"+ if [ "$PRE" = "true" ]; then+ echo "tag=v${VERSION_NAME}-pre" >> "$GITHUB_OUTPUT"+ echo "fname=${BASE}-pre" >> "$GITHUB_OUTPUT"+ else+ echo "tag=v${VERSION_NAME}" >> "$GITHUB_OUTPUT"+ echo "fname=${BASE}" >> "$GITHUB_OUTPUT"+ fiecho "raw=$RAW" >> "$GITHUB_OUTPUT"- echo "tag=v$VERSION_NAME" >> "$GITHUB_OUTPUT"+ echo "pre=$PRE" >> "$GITHUB_OUTPUT"- name: Notify Discord (build started)if: env.DISCORD_WEBHOOK_URL != ''@@ -117,22 +134,25 @@ jobs:- name: Build IPArun: flutter build ipa --release --export-options-plist=$HOME/export_options.plist- - name: Rename IPA with version+ - name: Rename IPA+ env:+ FNAME: ${{ steps.version.outputs.fname }}run: |IPA_SRC=$(ls build/ios/ipa/*.ipa | head -1)- mv "$IPA_SRC" "build/ios/ipa/absorb-${{ steps.version.outputs.raw }}.ipa"+ mv "$IPA_SRC" "build/ios/ipa/${FNAME}.ipa"- name: Upload IPA to GitHub draft releaseenv:GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}VERSION_TAG: ${{ steps.version.outputs.tag }}+ PRE: ${{ steps.version.outputs.pre }}run: |if gh release view "$VERSION_TAG" &>/dev/null; thengh release upload "$VERSION_TAG" build/ios/ipa/*.ipa --clobberelse- gh release create "$VERSION_TAG" build/ios/ipa/*.ipa \- --draft \- --title "$VERSION_TAG"+ CREATE_ARGS=(--draft --title "$VERSION_TAG")+ [ "$PRE" = "true" ] && CREATE_ARGS+=(--prerelease)+ gh release create "$VERSION_TAG" build/ios/ipa/*.ipa "${CREATE_ARGS[@]}"fi# Upload the IPA to TestFlight but DO NOT submit it for beta review. The