yubioath-flutter/.github/workflows/windows.yml
dependabot[bot] d65effe8e0
Bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/upload-artifact` from 3 to 4
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

Updates `github/codeql-action` from 2 to 3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-18 12:15:56 +00:00

99 lines
3.0 KiB
YAML

name: Windows
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Read variables from repo
shell: bash
run: cat .github/workflows/env >> $GITHUB_ENV
- name: Check app versions
run: |
python set-version.py
git diff --exit-code
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYVER }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Cache helper
id: cache-helper
uses: actions/cache@v3
with:
path: |
build/windows/helper
assets/licenses/helper.json
key: ${{ runner.os }}-py${{ env.PYVER }}-${{ hashFiles('helper/**') }}
- name: Build the Helper
if: steps.cache-helper.outputs.cache-hit != 'true'
run: |
pip install poetry
.\build-helper.bat
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ env.FLUTTER }}
- run: flutter config --enable-windows-desktop
- run: flutter --version
- name: Run lints/tests
env:
SKIP: ${{ steps.cache-helper.outputs.cache-hit == 'true' && 'mypy,flake8,black,bandit' || ''}}
run: |
pip install pre-commit
pre-commit run --all-files
flutter test
- name: Build the app
run: |
$version = python set-version.py | select-object -first 1
flutter build windows --build-name=$version
- name: Check generated files
run: git diff -I '.*android.*flutter_plugins.*qrscanner_zxing' --exit-code
- name: Move .dll files
run: |
$dest = "build\windows\x64\runner\Release"
cp $dest\helper\_internal/MSVCP140.dll $dest\
cp $dest\helper\_internal/VCRUNTIME140.dll $dest\
cp $dest\helper\_internal/VCRUNTIME140_1.dll $dest\
- name: Create an unsigned .msi installer package
run: |
$env:PATH += ";$env:WIX\bin"
$env:SRCDIR = "build\windows\x64\runner\Release\"
heat dir .\build\windows\x64\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
- 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\x64\runner\Release\* $dest\
mv yubioath-desktop.msi deploy
mv resources\win\release-win.ps1 deploy
mv resources deploy
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: yubioath-desktop-windows
path: deploy