Merge pull request #70 from MAGICGrants/version-bump #12
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| version: | |
| name: Extract version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.VERSION }} | |
| tag: ${{ steps.version.outputs.TAG }} | |
| steps: | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| build-android: | |
| name: Android | |
| runs-on: ubuntu-latest | |
| environment: Release | |
| needs: version | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Pull builder image | |
| run: docker pull ghcr.io/magicgrants/skylight-wallet-builder:latest | |
| - name: Set up Android signing | |
| run: | | |
| echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > ./android/keystore.jks | |
| cat > android/key.properties << EOF | |
| storePassword=${{ secrets.ANDROID_STORE_PASSWORD }} | |
| keyPassword=${{ secrets.ANDROID_KEY_PASSWORD }} | |
| keyAlias=${{ secrets.ANDROID_KEY_ALIAS }} | |
| storeFile=/workspace/android/keystore.jks | |
| EOF | |
| - name: Build APKs and AAB | |
| run: | | |
| VERSION='${{ needs.version.outputs.version }}' | |
| docker run --rm \ | |
| -v "$PWD:/workspace" \ | |
| -w /workspace \ | |
| ghcr.io/magicgrants/skylight-wallet-builder:latest \ | |
| bash -c "flutter pub get && flutter build apk --dart-define=DEMO_MODE=true --release --split-per-abi && flutter build appbundle --dart-define=DEMO_MODE=true --release" | |
| mkdir -p dist | |
| cp -v build/app/outputs/flutter-apk/app-arm64-v8a-release.apk "dist/skylight-wallet-${VERSION}-arm64-v8a.apk" | |
| cp -v build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk "dist/skylight-wallet-${VERSION}-armeabi-v7a.apk" | |
| cp -v build/app/outputs/flutter-apk/app-x86_64-release.apk "dist/skylight-wallet-${VERSION}-x86_64.apk" | |
| cp -v build/app/outputs/bundle/release/app-release.aab "dist/skylight-wallet-${VERSION}.aab" | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android | |
| path: | | |
| dist/*.apk | |
| dist/*.aab | |
| build-linux-x86_64: | |
| name: Linux (x86_64) | |
| runs-on: ubuntu-latest | |
| environment: Release | |
| needs: version | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Pull builder image | |
| run: docker pull ghcr.io/magicgrants/skylight-wallet-builder:latest | |
| - name: Build Linux packages | |
| run: | | |
| VERSION='${{ needs.version.outputs.version }}' | |
| docker run --rm \ | |
| -v "$PWD:/workspace" \ | |
| -w /workspace \ | |
| ghcr.io/magicgrants/skylight-wallet-builder:latest \ | |
| bash -c "flutter pub get && flutter build linux --release && ./deb/build_deb.sh --version ${VERSION} && ./appimage/build_appimage.sh --version ${VERSION}" | |
| mkdir -p dist | |
| cp -v deb/skylight-wallet_*.deb dist/ | |
| cp -v appimage/skylight-wallet-*.AppImage dist/ | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-x86_64 | |
| path: | | |
| dist/*.deb | |
| dist/*.AppImage | |
| release: | |
| name: Sign + Release | |
| runs-on: ubuntu-latest | |
| environment: Release | |
| needs: | |
| - version | |
| - build-android | |
| - build-linux-x86_64 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: List downloaded artifacts | |
| run: | | |
| echo "=== dist tree ===" | |
| find dist -type f -maxdepth 3 -print | |
| - name: Import GPG key | |
| run: | | |
| echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import | |
| - name: Sign artifacts with GPG | |
| env: | |
| GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| run: | | |
| set -euo pipefail | |
| find dist -type f \( -name "*.apk" -o -name "*.aab" -o -name "*.deb" -o -name "*.AppImage" \) -print0 | while IFS= read -r -d '' file; do | |
| echo "$GPG_PASSPHRASE" | gpg --batch --yes --pinentry-mode loopback --passphrase-fd 0 --detach-sign --armor "$file" | |
| echo "Signed: $file" | |
| done | |
| echo "=== Generated signatures ===" | |
| find dist -name "*.asc" -type f -print | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: ${{ needs.version.outputs.tag }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: | | |
| dist/**/*.apk | |
| dist/**/*.apk.asc | |
| dist/**/*.aab | |
| dist/**/*.aab.asc | |
| dist/**/*.deb | |
| dist/**/*.deb.asc | |
| dist/**/*.AppImage | |
| dist/**/*.AppImage.asc | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |