diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 0000000..4823d10 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -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/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 }} \ No newline at end of file