build: Snapcraft from local build file #1046
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: Main Deploy Workflow | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: main_deploy | |
cancel-in-progress: true | |
jobs: | |
deploy_web: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: Remove Emoji Font | |
run: | | |
rm -rf fonts/NotoEmoji | |
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml | |
- run: flutter pub get | |
- name: Prepare web | |
run: ./scripts/prepare-web.sh | |
- name: Build Release Web | |
run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps --base-href "/nightly/" | |
- run: mv build/web/ public | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }} | |
publish_dir: ./public | |
publish_branch: gh-pages | |
destination_dir: nightly | |
deploy_playstore_internal: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: 'zulu' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' | |
- name: Install Fastlane | |
run: gem install fastlane -NV | |
- name: Apply Google Services Patch | |
run: git apply ./scripts/enable-android-google-services.patch | |
- name: Remove Emoji Font | |
run: | | |
rm -rf fonts/NotoEmoji | |
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml | |
- run: flutter pub get | |
- name: Prepare Android Release Build | |
env: | |
FDROID_KEY: ${{ secrets.FDROID_KEY }} | |
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }} | |
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }} | |
run: ./scripts/prepare-android-release.sh | |
- name: Build Android Release | |
run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 | |
- name: Deploy Android Release | |
run: | | |
mkdir -p build/android | |
cp build/app/outputs/bundle/release/app-release.aab build/android/ | |
cd android | |
bundle install | |
bundle update fastlane | |
bundle exec fastlane deploy_internal_test | |
cd .. | |
deploy_snapcraft: | |
strategy: | |
matrix: | |
arch: [ x64, arm64 ] | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
runs-on: ${{ matrix.arch == 'arm64' && 'self-hosted' || 'ubuntu-latest'}} | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install git wget curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev -y | |
- name: Install Flutter | |
run: | | |
git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git | |
./flutter/bin/flutter doctor | |
- run: ./flutter/bin/flutter pub get | |
- run: ./flutter/bin/flutter build linux --target-platform linux-${{ matrix.arch }} --release | |
- name: Install Snapcraft | |
uses: samuelmeuli/action-snapcraft@v3 | |
- run: snapcraft | |
- run: snapcraft push ./*.snap |