ci: try to fix android release build #390
This file contains 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: Canary Release | |
on: push | |
jobs: | |
android: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup | Java | |
uses: actions/setup-java@v2 | |
with: | |
distribution: "zulu" | |
java-version: "17" | |
- name: Setup | Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Setup | Dependencies | |
run: | | |
flutter pub get | |
dart pub global activate flutterfire_cli | |
- name: Setup | Android NDK | |
run: | | |
# /usr/include/bits | |
sudo apt update -y | |
sudo apt install libc6-dev-i386 | |
# Install rust targets | |
rustup target add aarch64-linux-android armv7-linux-androideabi x86_64-linux-android i686-linux-android | |
rustup update | |
# Install cargo-ndk | |
# cargo install cargo-ndk | |
# cd annix | |
# cargo ndk -o ../android/app/src/main/jniLibs build | |
# cd .. | |
- name: Setup | Keystore | |
run: | | |
echo "${{ secrets.ANDROID_KEYSTORE }}" | base64 -d > keystore.jks | |
echo "${{ secrets.ANDROID_KEYSTORE_PROPERTIES }}" | base64 -d > ./android/keystore.properties | |
- name: Build | Apk | |
run: flutter build apk --verbose --split-per-abi | |
- name: Deploy | Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: annix-android | |
path: | | |
./build/app/outputs/apk/release/*.apk | |
retention-days: 1 | |
linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup | Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Setup | Dependencies | |
run: | | |
sudo apt update -y | |
sudo apt install -y libunwind-dev libasound2-dev | |
sudo apt install -y tar clang cmake ninja-build pkg-config libgtk-3-dev make python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace fuse libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libjsoncpp-dev | |
rustup update | |
flutter config --enable-linux-desktop | |
flutter pub get | |
dart pub global activate flutterfire_cli | |
- name: Build | Linux | |
run: | | |
flutter build linux --verbose | |
cd build/linux/x64/release/ | |
zip -r annix-linux64.zip bundle | |
- name: Deploy | Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: annix-linux64 | |
path: ./build/linux/x64/release/annix-linux64.zip | |
retention-days: 1 | |
macOS: | |
runs-on: macos-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup | Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Setup | Dependencies | |
run: | | |
rustup target add x86_64-apple-darwin aarch64-apple-darwin | |
rustup update | |
flutter pub get | |
dart pub global activate flutterfire_cli | |
- name: Build | macOS | |
run: | | |
flutter build macos --verbose | |
cd build/macos/Build/Products/Release | |
ditto -c -k --sequesterRsrc --keepParent Annix.app annix-macos.zip | |
- name: Deploy | Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: annix-macos | |
path: | | |
./build/macos/Build/Products/Release/annix-macos.zip | |
retention-days: 1 | |
windows: | |
runs-on: windows-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup | Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Setup | Dependencies | |
run: | | |
rustup update | |
flutter config --enable-windows-desktop | |
flutter pub get | |
dart pub global activate flutterfire_cli | |
- name: Build | Windows | |
run: | | |
flutter build windows --verbose | |
cp -r build/windows/x64/runner/Release annix-win64 | |
tar.exe -a -c -f annix-win64.zip annix-win64 | |
- name: Deploy | Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: annix-win64 | |
path: | | |
./annix-win64.zip | |
retention-days: 1 | |
iOS: | |
runs-on: macos-latest | |
env: | |
KEYCHAIN: job-${{ github.job }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }} | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup | Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: beta | |
- name: Setup | Dependencies | |
run: | | |
rustup target add x86_64-apple-darwin aarch64-apple-darwin | |
rustup update | |
flutter pub get | |
dart pub global activate flutterfire_cli | |
- name: Build | iOS | |
run: | | |
flutter build ios --no-codesign --verbose --build-number ${{ github.run_number }} | |
cp -r build/ios/iphoneos Payload | |
zip -r annix-ios.zip Payload | |
mv annix-ios.zip annix-ios.ipa | |
- name: Deploy | Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: annix-ios | |
path: ./annix-ios.ipa | |
retention-days: 1 | |
publish: | |
if: ${{ github.ref == 'refs/heads/master' }} | |
needs: [android, linux, macOS, windows, iOS] | |
runs-on: ubuntu-20.04 | |
env: | |
GH_REPO: ${{ github.repository }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
- name: Install dependencies | |
run: sudo apt update && sudo apt install -y gettext-base | |
- run: | | |
(echo 'SUBJECT=Annix development (canary) build') >> $GITHUB_ENV | |
gh release delete canary --yes || true | |
git push origin :canary || true | |
- name: Publish release | |
run: | | |
gh release create canary --prerelease --title "$SUBJECT" --target $GITHUB_SHA annix-android/*.apk annix-linux64/* annix-macos/* annix-win64/* annix-ios/* |