ci: add test zip

This commit is contained in:
Tien Do Nam
2023-11-29 22:37:15 +01:00
parent aa17a89ab3
commit 3369facd6c
+60
View File
@@ -0,0 +1,60 @@
name: Build windows zip
on:
workflow_dispatch:
env:
FLUTTER_VERSION: "3.16.1"
jobs:
build:
runs-on: ubuntu-20.04
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Get version from pubspec.yaml
id: get_version
run: |
VERSION=$(sed -n 's/^version: \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/p' app/pubspec.yaml)
echo "version=$VERSION" >> $GITHUB_OUTPUT
build_windows_zip:
needs: build
runs-on: windows-latest
steps:
- name: Fix long file paths
run: git config --system core.longpaths true
- name: Checkout repository
uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
- name: Dependencies
working-directory: app
run: flutter pub get
- name: Compile for Windows
working-directory: app
run: flutter build windows
- name: Create empty settings.json
working-directory: app
run: echo {} > build/windows/x64/runner/Release/settings.json
- name: Zip compiled files
working-directory: app
run: Compress-Archive -Path build/windows/x64/runner/Release/* -DestinationPath LocalSend.zip
- name: Upload zip
uses: actions/upload-artifact@v3
with:
name: windows-zip-result
path: app/LocalSend.zip