-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1629c9
commit 401f546
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# .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.0 | ||
|
||
- 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/[email protected] | ||
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 }} |