Skip to content

Merge pull request #90 from MAGICGrants/bump #20

Merge pull request #90 from MAGICGrants/bump

Merge pull request #90 from MAGICGrants/bump #20

Workflow file for this run

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: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune -af
df -h
- 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
build-windows:
name: Windows (x64)
runs-on: windows-latest
environment: Release
needs: version
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.41.0
- name: Install dependencies
run: flutter pub get
- name: Install Inno Setup
run: choco install innosetup -y
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- name: Build Windows release
run: flutter build windows --release
- name: Create installer
run: |
$version = '${{ needs.version.outputs.version }}'.TrimStart('v')
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /DAppVersion=$version windows\installer.iss
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-x64
path: windows/Output/*.exe
release:
name: Sign + Release
runs-on: ubuntu-latest
environment: Release
needs:
- version
- build-android
- build-linux-x86_64
- build-windows
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" -o -name "*.exe" \) -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
dist/**/*.exe
dist/**/*.exe.asc
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}