setup FW Lite as a maui app #76
Workflow file for this run
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
name: FieldWorks Lite | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'backend/FwLite/**' | |
- 'backend/harmony/**' | |
- 'frontend/viewer/**' | |
- '.github/workflows/fw-lite.yaml' | |
branches: | |
- develop | |
pull_request: | |
paths: | |
- 'backend/FwLite/**' | |
- 'backend/harmony/**' | |
- 'frontend/viewer/**' | |
- '.github/workflows/fw-lite.yaml' | |
branches: | |
- develop | |
jobs: | |
build-and-test: | |
name: Build FW Lite and run tests | |
timeout-minutes: 20 | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.x' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: './frontend/package.json' | |
- name: Dotnet build | |
working-directory: backend/FwLite/LocalWebApp | |
run: dotnet build --configuration Release | |
- name: Dotnet test | |
working-directory: backend/FwLite/LcmCrdt.Tests | |
run: dotnet test --configuration Release --logger GitHubActions | |
- name: Build viewer | |
working-directory: frontend/viewer | |
run: | | |
corepack enable | |
pnpm install | |
pnpm run build-app | |
publish-app: | |
name: Publish FW Lite app and sign installer | |
# only publish if tag matches fwlite-v* pattern | |
# iif: startsWith(github.ref, 'refs/tags/fwlite-v') | |
needs: build-and-test | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.x' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: './frontend/package.json' | |
- name: Setup Maui | |
run: dotnet workload install maui-windows | |
- name: Dotnet build | |
working-directory: backend/FwLite/LocalWebApp | |
run: dotnet build --configuration Release | |
- name: Publish Linux | |
working-directory: backend/FwLite/LocalWebApp | |
run: dotnet publish -r linux-x64 --artifacts-path ../artifacts | |
- name: Publish OSX | |
working-directory: backend/FwLite/LocalWebApp | |
run: dotnet publish -r osx-x64 --artifacts-path ../artifacts | |
- name: Publish OSX ARM | |
working-directory: backend/FwLite/LocalWebApp | |
run: dotnet publish -r osx-arm64 --artifacts-path ../artifacts | |
- name: Publish Windows | |
working-directory: backend/FwLite/LocalWebApp | |
run: dotnet publish -r win-x64 --artifacts-path ../artifacts | |
- name: Publish Windows ARM | |
working-directory: backend/FwLite/LocalWebApp | |
run: dotnet publish -r win-arm64 --artifacts-path ../artifacts | |
- name: Publish Windows MAUI app | |
working-directory: backend/FwLite/FwLiteDesktop | |
run: | | |
dotnet publish -f net8.0-windows10.0.19041.0 -r win-x64 --artifacts-path ../artifacts -p:Platform=x64 | |
dotnet publish -f net8.0-windows10.0.19041.0 -r win-arm64 --artifacts-path ../artifacts -p:Platform=arm64 | |
- name: Upload artifacts | |
# uploading in one artifact as there's a lot of duplication between builds so compression goes far | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fw-lite | |
if-no-files-found: error | |
path: | | |
backend/FwLite/artifacts/publish/LocalWebApp/* | |
backend/FwLite/artifacts/bin/FwLiteDesktop/*/AppPackages/FwLiteDesktop_1.0.0.1_Test/*.msix | |
sign-installer: | |
name: Sign FWLite MSIX installer | |
needs: publish-app | |
uses: sillsdev/codesign/.github/workflows/sign.yml@v2 | |
with: | |
artifact: fw-lite | |
secrets: | |
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }} | |
create-release: | |
name: Create Release | |
needs: sign-installer | |
runs-on: windows-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
backend/FwLite/artifacts/bin/FwLiteDesktop/*/AppPackages/FwLiteDesktop_1.0.0.1_Test/*.msix | |
body: | | |
Release for version ${{ github.ref }} | |
draft: true |