2021-11-19 11:22:27 +03:00
|
|
|
name: Windows
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
|
|
|
|
runs-on: windows-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Set up Python
|
|
|
|
uses: actions/setup-python@v2
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
|
2022-05-13 11:46:36 +03:00
|
|
|
- name: Check app versions
|
|
|
|
run: |
|
|
|
|
python set-version.py
|
|
|
|
git diff --exit-code
|
|
|
|
|
2021-11-19 11:22:27 +03:00
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
choco install swig
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install poetry
|
|
|
|
|
2022-04-27 15:42:05 +03:00
|
|
|
- uses: subosito/flutter-action@v2
|
2021-11-19 11:22:27 +03:00
|
|
|
with:
|
2022-05-12 09:36:47 +03:00
|
|
|
channel: 'stable'
|
2021-11-19 11:22:27 +03:00
|
|
|
- run: flutter config --enable-windows-desktop
|
|
|
|
- run: flutter --version
|
|
|
|
|
2021-11-19 12:23:01 +03:00
|
|
|
- name: Run tests
|
2021-11-19 13:20:57 +03:00
|
|
|
run: |
|
|
|
|
flutter test
|
|
|
|
flutter analyze
|
2021-11-19 12:23:01 +03:00
|
|
|
|
2022-05-06 17:31:46 +03:00
|
|
|
- name: Build the Helper
|
|
|
|
run: .\build-helper.bat
|
2021-11-19 11:22:27 +03:00
|
|
|
|
|
|
|
- name: Build the app
|
2021-11-19 12:23:01 +03:00
|
|
|
run: flutter build windows
|
2021-11-19 11:22:27 +03:00
|
|
|
|
2022-04-04 16:43:04 +03:00
|
|
|
- name: Check generated files
|
2022-04-22 17:44:48 +03:00
|
|
|
run: git diff -I '.*android.*flutter_plugins.*qrscanner_zxing' --exit-code
|
2022-04-04 16:43:04 +03:00
|
|
|
|
2022-03-04 13:00:41 +03:00
|
|
|
- name: Move .dll files
|
|
|
|
run: |
|
|
|
|
$dest = "build\windows\runner\Release"
|
2022-05-06 17:31:46 +03:00
|
|
|
cp $dest\helper\MSVCP140.dll $dest\
|
|
|
|
cp $dest\helper\VCRUNTIME140.dll $dest\
|
|
|
|
cp $dest\helper\VCRUNTIME140_1.dll $dest\
|
2022-03-04 13:00:41 +03:00
|
|
|
|
|
|
|
|
|
|
|
- name: Create an unsigned .msi installer package
|
|
|
|
run: |
|
|
|
|
$env:PATH += ";$env:WIX\bin"
|
|
|
|
$env:SRCDIR = "build\windows\runner\Release\"
|
|
|
|
heat dir .\build\windows\runner\Release\ -out fragment.wxs -gg -scom -srd -sfrag -dr INSTALLDIR -cg ApplicationFiles -var env.SRCDIR
|
|
|
|
candle .\fragment.wxs .\resources\win\yubioath-desktop.wxs -ext WixUtilExtension -arch x64
|
|
|
|
light fragment.wixobj yubioath-desktop.wixobj -ext WixUIExtension -ext WixUtilExtension -o yubioath-desktop.msi
|
|
|
|
|
2021-11-19 11:22:27 +03:00
|
|
|
- name: Rename and archive app bundle
|
|
|
|
run: |
|
|
|
|
$arr = $env:GITHUB_REF -split '/'
|
|
|
|
$branch = $arr[2]
|
|
|
|
$dest = "deploy\yubioath-desktop-$branch-windows"
|
|
|
|
mkdir $dest
|
|
|
|
mv build\windows\runner\Release\* $dest\
|
2022-03-04 13:00:41 +03:00
|
|
|
mv yubioath-desktop.msi deploy
|
2021-11-19 11:22:27 +03:00
|
|
|
|
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v1
|
|
|
|
with:
|
|
|
|
name: yubioath-desktop-windows
|
|
|
|
path: deploy
|