update #11
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: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Run tests | |
run: flutter test | |
- name: Build for Web | |
if: matrix.os == 'ubuntu-latest' | |
run: flutter build web | |
- name: Build for Windows | |
if: matrix.os == 'windows-latest' | |
run: flutter build windows | |
- name: Build for Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install -y ninja-build libgtk-3-dev | |
flutter build linux | |
release: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create Tag | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "[email protected]" | |
git tag -a v1.1.0 -m "Release v1.1.0" | |
git push origin v1.1.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GHP }} | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
build/web/**/* | |
build/windows/runner/Release/*.exe | |
build/linux/x64/release/bundle/* | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |