toast #140
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: Test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
android: | |
name: Android | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Decrypt large secret | |
run: chmod +x ./.github/scripts/decrypt_secret.sh&&./.github/scripts/decrypt_secret.sh | |
env: | |
LARGE_SECRET_PASSPHRASE: ${{ secrets.GPG_LARGE_SECRET_PASSPHRASE }} | |
- name: Set up Dart | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: stable | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- run: flutter pub upgrade | |
- run: flutter pub get | |
- run: flutter build apk --release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: app-release-all.apk | |
path: ./build/app/outputs/flutter-apk/app-release.apk | |
ios: | |
name: iOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Dart | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: stable | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- run: flutter config --no-enable-android | |
- run: flutter pub get | |
- run: flutter build ipa --release --no-codesign | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Runner.xcarchive | |
path: ./build/ios/archive/Runner.xcarchive | |
linux: | |
name: Linux | |
runs-on: ubuntu-latest | |
env: | |
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- name: Install required build tools for linux | |
run: sudo apt-get update && sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev | |
- name: Build linux release | |
run: | | |
flutter config --enable-linux-desktop | |
flutter config --no-enable-android | |
flutter pub get | |
flutter build linux --release | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: linux-release.zip | |
path: ./build/linux/x64/release/bundle | |
- run: rm -rf ./build | |
- name: Install snapcraft | |
run: | | |
sudo snap install snapcraft --classic | |
- run: hash -r | |
- name: Setup LXD | |
uses: canonical/setup-lxd@v0.1.1 | |
with: | |
channel: latest/stable | |
- name: run snapcraft | |
run: | | |
snapcraft --use-lxd | |
- run: ls -a | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: openiothub_0.1.0_amd64.snap | |
path: ./openiothub_0.1.0_amd64.snap | |
# | |
macos: | |
name: MacOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- run: flutter config --enable-macos-desktop | |
- run: flutter config --no-enable-android | |
- run: flutter pub get | |
- run: flutter build macos --release | |
- run: mkdir -p build/dmg | |
- run: cp -R build/macos/Build/Products/Release/openiothub.app build/dmg/openiothub.app | |
- run: ln -s /Applications build/dmg | |
- run: ls build/dmg | |
# https://github.com/create-dmg/create-dmg.git | |
- run: hdiutil create -srcfolder build/dmg -volname "OpenIoTHub" -format UDZO -ov -imagekey zlib-level=9 openiothub.dmg | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: openiothub.dmg | |
path: ./openiothub.dmg | |
# | |
windows: | |
name: Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
- run: flutter config --enable-windows-desktop | |
- run: flutter config --no-enable-android | |
- run: flutter pub get | |
- run: flutter build windows --release | |
# - run: Compress-Archive -Path build\windows\runner\Release -DestinationPath windows-release.zip | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: windows-release.zip | |
path: ./build/windows/runner/Release | |
- run: dart run msix:create | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: openiothub.msix | |
path: ./build/windows/runner/Release/openiothub.msix |