Skip to content

Release

Release #84

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
permissions:
contents: write
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
- name: Release APK
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./build/app/outputs/flutter-apk/app-release.apk
LICENSE
body_path: ./.github/doc/DownloadDescription.md
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
- name: Release iOS IPA
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./build/ios/archive/Runner.xcarchive
LICENSE
body_path: ./.github/doc/DownloadDescription.md
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
# - name: Release Linux Zip
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: |
# ./build/linux/x64/release/bundle
# LICENSE
# body_path: ./.github/doc/DownloadDescription.md
- 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: snapcraft upload --release=stable *.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
- name: Release MacOS dmg
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./openiothub.dmg
LICENSE
body_path: ./.github/doc/DownloadDescription.md
#
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
# - name: Release windows zip
# uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
# with:
# files: |
# ./build/windows/runner/Release
# LICENSE
# body_path: ./.github/doc/DownloadDescription.md
- run: dart run msix:create
- name: Release windows msix
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
./build/windows/runner/Release/openiothub.msix
LICENSE
body_path: ./.github/doc/DownloadDescription.md