diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..ef1445f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,60 @@ +name: Release + +# Push a tag like v1.1.0 (after bumping the version in pubspec.yaml) to build a signed +# release APK and publish it as a GitHub Release. +on: + push: + tags: + - "v*.*.*" + +jobs: + build-and-release: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: "temurin" + java-version: "17" + + - uses: subosito/flutter-action@v2 + with: + flutter-version: "3.47.4" + channel: "stable" + + - run: flutter pub get + - run: flutter analyze + - run: flutter test + env: + TZ: Europe/Warsaw + + # Never publish a debug-signed APK: it can't update a release install. + - name: Write release signing config + env: + ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} + ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} + run: | + if [ -z "$ANDROID_KEYSTORE_BASE64" ]; then + echo "::error::Set the ANDROID_KEYSTORE_BASE64, ANDROID_KEYSTORE_PASSWORD and ANDROID_KEY_ALIAS secrets first" + exit 1 + fi + mkdir -p android/keystore + echo "$ANDROID_KEYSTORE_BASE64" | base64 -d > android/keystore/release-key.jks + cat > android/key.properties <