Merge pull request #1 from guchengxi1994/master #2
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
# .github\workflows\build.yml | |
name: build and release windows | |
on: | |
push: | |
branches: | |
- release | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Install flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: 3.22.2 | |
- name: Cache pubspec | |
id: cache-pubspec | |
uses: actions/cache@v3 | |
with: | |
path: | | |
${{ env.FLUTTER_HOME }}/.pub-cache | |
**/.flutter-plugins | |
**/.flutter-plugin-dependencies | |
**/.dart_tool/package_config.json | |
key: pubspec-${{ hashFiles('**/pubspec.lock') }} | |
restore-keys: | | |
pubspec- | |
- name: Run pub get | |
run: flutter pub get | |
- name: Bump build number | |
run: | | |
flutter pub global activate cider | |
- name: Build windows | |
run: | | |
flutter config --enable-windows-desktop | |
flutter build windows -v --release | |
- name: Set tag name | |
run: echo "tag_name=v$(cider version)" >> $env:GITHUB_ENV | |
- name: Archive release | |
uses: thedoctor0/zip-release@0.7.6 | |
with: | |
type: 'zip' | |
filename: 'windows.zip' | |
directory: build/windows/x64/runner/Release | |
- name: Publish release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
artifacts: build/windows/x64/runner/Release/windows.zip | |
generateReleaseNotes: true | |
tag: ${{ env.tag_name }} | |
token: ${{ secrets.RELEASE_TOKEN }} |