Skip to content

update

update #6

Workflow file for this run

name: Flutter CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types: [published]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
platform: linux
- os: windows-latest
platform: windows
- os: ubuntu-latest
platform: web
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.24.3
- name: Install dependencies
run: flutter pub get
- name: Run tests
run: flutter test
- name: Build for ${{ matrix.platform }}
if: matrix.platform != 'web'
run: flutter build ${{ matrix.platform }}
- name: Build for web
if: matrix.platform == 'web'
run: flutter build web
- name: Upload build artifacts
if: github.event_name == 'release' && github.event.action == 'published'
uses: actions/upload-artifact@v3
with:
name: flutter-build-${{ matrix.platform }}
path: build/${{ matrix.platform }}
publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: flutter-build-linux
path: build/linux
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: flutter-build-windows
path: build/windows
- name: Download build artifacts
uses: actions/download-artifact@v3
with:
name: flutter-build-web
path: build/web
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "build/linux/**,build/windows/**,build/web/**"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
body: "Automated release for tag ${{ github.ref_name }}"