Update dart.yml #29
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: Flutter CI | |
on: push | |
jobs: | |
build-and-release-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.19.0' | |
- name: Install project dependencies | |
run: flutter pub get | |
- name: Build artifacts | |
run: flutter build apk --release | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: ${{github.ref_name}}-apk.zip | |
directory: build/app/outputs/apk/release | |
- name: Android Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/app/outputs/apk/release/${{github.ref_name}}-apk.zip | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Android | |
path: build/app/outputs/apk/release/${{github.ref_name}}-apk.zip | |
build-and-release-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.19.0' | |
- name: Install dependencies | |
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev | |
- name: Install project dependencies | |
run: flutter pub get | |
- name: Build artifacts | |
run: flutter build linux --release | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: ${{github.ref_name}}-linux.zip | |
directory: build/linux/x64/release/bundle | |
- name: Linux Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/linux/x64/release/bundle/${{github.ref_name}}-linux.zip | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Linux | |
path: build/linux/x64/release/bundle/${{github.ref_name}}-linux.zip | |
build-and-release-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.19.0' | |
- name: Install project dependencies | |
run: flutter pub get | |
- name: Build artifacts | |
run: flutter build windows --release | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: ${{github.ref_name}}-windows.zip | |
directory: build/windows/x64/runner/Release | |
- name: Windows Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/windows/x64/runner/Release/${{github.ref_name}}-windows.zip | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WindowsX64 | |
path: build/windows/x64/runner/Release/${{github.ref_name}}-windows.zip | |
build-and-release-macos: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.19.0' | |
- name: Install project dependencies | |
run: flutter pub get | |
- name: Build artifacts | |
run: flutter build macos --release | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: ${{github.ref_name}}-macos.zip | |
directory: build/macos/Build/Products/Release | |
- name: macOS Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/macos/Build/Products/Release/${{github.ref_name}}-macos.zip | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: MacOS | |
path: build/macos/Build/Products/Release/${{github.ref_name}}-macos.zip | |
build-and-release-ios: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
flutter-version: '3.19.0' | |
- name: Install project dependencies | |
run: flutter pub get | |
- name: Build artifacts | |
run: flutter build ios --release --no-codesign | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: ${{github.ref_name}}-ios.zip | |
directory: build/ios/iphoneos | |
- name: iOS Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: build/ios/iphoneos/${{github.ref_name}}-ios.zip | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: iOS | |
path: build/ios/iphoneos/${{github.ref_name}}-ios.zip | |