diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ead8289..7ac5e34 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release (Manual/Draft) +name: Build and Release on: workflow_dispatch: @@ -10,53 +10,61 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: subosito/flutter-action@v2 + - name: Import GPG key + id: import_pgp_key + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.PGP_KEY_BASE64 }} + passphrase: ${{ secrets.PGP_PASSPHRASE }} + - name: Build APKs run: | sed -i 's/signingConfig signingConfigs.release//g' android/app/build.gradle flutter build apk && flutter build apk --split-per-abi + rm ./build/app/outputs/flutter-apk/*.sha1 + ls -l ./build/app/outputs/flutter-apk/ - name: Sign APKs env: KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }} - KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }} - GPG_KEY: ${{ secrets.GPG_KEY }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} run: | echo "${KEYSTORE_BASE64}" | base64 -d > apksign.keystore - echo "$GPG_KEY" | gpg --import for apk in ./build/app/outputs/flutter-apk/*-release*.apk; do unsignedFn=${apk/-release/-unsigned} mv "$apk" "$unsignedFn" - ${ANDROID_HOME}/build-tools/30.0.2/apksigner sign --ks apksign.keystore --ks-pass env:KEYSTORE_PASS --out "${apk}" "${unsignedFn}" + ${ANDROID_HOME}/build-tools/30.0.2/apksigner sign --ks apksign.keystore --ks-pass pass:"${KEYSTORE_PASSWORD}" --out "${apk}" "${unsignedFn}" sha256sum ${apk} | cut -d " " -f 1 > "$apk".sha256 - gpg --sign --detach-sig "$apk".sha256 + gpg --batch --pinentry-mode loopback --passphrase "${PGP_PASSPHRASE}" --sign --detach-sig "$apk".sha256 done rm apksign.keystore + PGP_KEY_FINGERPRINT="${{ steps.import_pgp_key.outputs.fingerprint }}" - name: Extract Version id: extract_version run: | VERSION=$(grep -oP "currentVersion = '\K[^']+" lib/main.dart) - echo "::set-output name=version::$VERSION" + echo "version=$VERSION" >> $GITHUB_OUTPUT TAG=$(grep -oP "'.*\\\$currentVersion.*'" lib/main.dart | head -c -2 | tail -c +2 | sed "s/\$currentVersion/$VERSION/g") - echo "::set-output name=tag::$TAG" + echo "tag=$TAG" >> $GITHUB_OUTPUT if [ -n "$(echo $TAG | grep -oP '\-beta$')" ]; then BETA=true; else BETA=false; fi - echo "::set-output name=beta::$BETA" + echo "beta=$BETA" >> $GITHUB_OUTPUT + + - name: Create Tag + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GH_ACCESS_TOKEN }} + custom_tag: "${{ steps.extract_version.outputs.tag }}" + tag_prefix: "" - name: Create Release And Upload APKs uses: ncipollo/release-action@v1 with: - token: ${{ secrets.GAT }} + token: ${{ secrets.GH_ACCESS_TOKEN }} tag: "${{ steps.extract_version.outputs.tag }}" prerelease: "${{ steps.extract_version.outputs.beta }}" artifacts: ./build/app/outputs/flutter-apk/*-release*.apk* - draft: true - - - name: Archive Reports For Job - uses: actions/upload-artifact@v3 - with: - name: reports - path: '*/build/reports' - if: ${{ always() }} + generateReleaseNotes: true diff --git a/lib/app_sources/fdroid.dart b/lib/app_sources/fdroid.dart index 1201062..c7b2dda 100644 --- a/lib/app_sources/fdroid.dart +++ b/lib/app_sources/fdroid.dart @@ -11,6 +11,7 @@ class FDroid extends AppSource { FDroid() { host = 'f-droid.org'; name = tr('fdroid'); + naiveStandardVersionDetection = true; canSearch = true; additionalSourceAppSpecificSettingFormItems = [ [