Rename LocalWebApp to FwLiteWeb and reword other local-web-app refere… #562
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 | |
- main | |
pull_request: | |
paths: | |
- 'backend/FwLite/**' | |
- 'backend/harmony/**' | |
- 'frontend/viewer/**' | |
- '.github/workflows/fw-lite.yaml' | |
branches: | |
- develop | |
- main | |
env: | |
VIEWER_BUILD_OUTPUT_DIR: backend/FwLite/FwLiteShared/wwwroot/viewer | |
jobs: | |
build-and-test: | |
name: Build FW Lite and run tests | |
timeout-minutes: 40 | |
runs-on: windows-latest | |
outputs: | |
version: ${{ steps.setVersion.outputs.VERSION }} | |
semver-version: ${{ steps.setVersion.outputs.SEMVER_VERSION }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: './frontend/package.json' | |
- name: Set Version | |
id: setVersion | |
shell: bash | |
# set version to date in vYYYY-MM-DD-commitSha format, and semver version to YYYY.MM.DD | |
run: | | |
shortSha=$(echo ${{ github.sha }} | cut -c1-8) | |
echo "VERSION=v$(date --rfc-3339=date)-$shortSha" >> ${GITHUB_OUTPUT} | |
echo "SEMVER_VERSION=$(date +%Y.%-m.%-d)" >> ${GITHUB_OUTPUT} | |
- name: Build viewer | |
working-directory: frontend/viewer | |
run: | | |
corepack enable | |
pnpm install | |
pnpm run build-app | |
- name: Dotnet test | |
run: dotnet test FwLiteOnly.slnf --logger GitHubActions | |
- name: Upload viewer artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fw-lite-viewer-js | |
if-no-files-found: error | |
path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} | |
publish-mac: | |
name: Publish FW Lite app for Mac | |
needs: build-and-test | |
timeout-minutes: 30 | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-viewer-js | |
path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
- name: Dotnet build | |
working-directory: backend/FwLite/FwLiteWeb | |
run: dotnet build --configuration Release | |
- name: Publish OSX | |
working-directory: backend/FwLite/FwLiteWeb | |
run: dotnet publish -r osx-x64 --artifacts-path ../artifacts -p:Version=${{ needs.build-and-test.outputs.semver-version }} | |
- name: Publish OSX ARM | |
working-directory: backend/FwLite/FwLiteWeb | |
run: dotnet publish -r osx-arm64 --artifacts-path ../artifacts -p:Version=${{ needs.build-and-test.outputs.semver-version }} | |
#todo sign the app | |
- name: Upload local web app artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fw-lite-web-mac | |
if-no-files-found: error | |
path: backend/FwLite/artifacts/publish/FwLiteWeb/* | |
publish-linux: | |
name: Publish FW Lite app for Linux | |
needs: build-and-test | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-viewer-js | |
path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
- name: Publish Linux | |
working-directory: backend/FwLite/FwLiteWeb | |
run: dotnet publish -r linux-x64 --artifacts-path ../artifacts -p:PublishSingleFile=true -p:Version=${{ needs.build-and-test.outputs.semver-version }} | |
- name: Upload FWLite Linux artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fw-lite-web-linux | |
if-no-files-found: error | |
path: backend/FwLite/artifacts/publish/FwLiteWeb/* | |
publish-android: | |
name: Publish FW Lite app for Android | |
needs: build-and-test | |
timeout-minutes: 30 | |
runs-on: macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-viewer-js | |
path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
- name: Setup Maui | |
run: dotnet workload install maui | |
- name: Publish Android | |
working-directory: backend/FwLite/FwLiteMaui | |
run: dotnet publish -f net9.0-android --artifacts-path ../artifacts -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} -p:InformationalVersion=${{ needs.build-and-test.outputs.version }} | |
- name: Upload FWLite App artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fw-lite-android | |
if-no-files-found: error | |
path: backend/FwLite/artifacts/publish/FwLiteMaui/*/* | |
publish-win: | |
name: Publish FW Lite app for Windows | |
needs: build-and-test | |
timeout-minutes: 30 | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-viewer-js | |
path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} | |
- uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
- name: Setup Maui | |
run: dotnet workload install maui-windows | |
- name: Publish Windows MAUI portable app | |
working-directory: backend/FwLite/FwLiteMaui | |
run: | | |
dotnet publish -f net9.0-windows10.0.19041.0 --artifacts-path ../artifacts -p:WindowsPackageType=None -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} -p:InformationalVersion=${{ needs.build-and-test.outputs.version }} | |
mkdir -p ../artifacts/sign/portable | |
cp -r ../artifacts/publish/FwLiteMaui/* ../artifacts/sign/portable/ | |
- name: Publish Windows MAUI msix app | |
working-directory: backend/FwLite/FwLiteMaui | |
run: | | |
dotnet publish -f net9.0-windows10.0.19041.0 --artifacts-path ../artifacts -p:ApplicationDisplayVersion=${{ needs.build-and-test.outputs.semver-version }} -p:InformationalVersion=${{ needs.build-and-test.outputs.version }} | |
mkdir -p ../artifacts/msix | |
cp ../artifacts/bin/FwLiteMaui/*/AppPackages/*/*.msix ../artifacts/msix/ | |
- name: Bundle MSIX | |
working-directory: backend/FwLite/artifacts/msix | |
shell: pwsh | |
run: | | |
$SdkVersion = '10.0.19041.0' | |
$Architecture = 'x86' | |
$sdkToolsPath = Join-Path -Path 'C:\Program Files (x86)\Windows Kits\10\bin' -ChildPath $SdkVersion -AdditionalChildPath $Architecture | |
$env:Path += ";$sdkToolsPath" | |
MakeAppx.exe bundle /v /bv ${{ needs.build-and-test.outputs.semver-version }}.1 /d . /p ../sign/FwLiteMaui.msixbundle | |
- name: Sign with Trusted Signing | |
if: ${{ github.ref_name == 'develop' || github.ref_name == 'main' }} | |
uses: sillsdev/codesign/trusted-signing-action@v3 | |
with: | |
credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }} | |
files-folder: ${{ github.workspace }}/backend/FwLite/artifacts/sign | |
files-folder-filter: msixbundle,exe | |
files-folder-recurse: true | |
files-folder-depth: 4 | |
description: 'Release for version ${{ needs.build-and-test.outputs.version }} from branch ${{ github.ref_name || github.head_ref }}' | |
description-url: 'https://github.com/sillsdev/languageforge-lexbox' | |
- name: Upload FWLite Portable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fw-lite-portable | |
if-no-files-found: error | |
path: backend/FwLite/artifacts/sign/portable/* | |
- name: Upload FWLite MSIX | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fw-lite-msix | |
if-no-files-found: error | |
path: backend/FwLite/artifacts/sign/*.msixbundle | |
create-release: | |
if: ${{ github.ref_name == 'main' }} | |
name: Create Release | |
needs: [ build-and-test, publish-win, publish-linux, publish-mac, publish-android] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-msix | |
path: fw-lite-msix | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-portable | |
path: fw-lite-portable | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-web-linux | |
path: fw-lite-web-linux | |
- uses: actions/download-artifact@v4 | |
with: | |
name: fw-lite-android | |
path: fw-lite-android | |
- name: Zip artifacts | |
run: | | |
zip -r fw-lite-portable.zip fw-lite-portable | |
chmod +x fw-lite-web-linux/*/FwLiteWeb | |
zip -r fw-lite-web-linux.zip fw-lite-web-linux | |
- name: Create Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
tag_name: ${{ needs.build-and-test.outputs.version }} | |
target_commitish: ${{ github.sha }} | |
generate_release_notes: true | |
files: | | |
fw-lite-msix/* | |
fw-lite-portable.zip | |
fw-lite-web-linux.zip | |
fw-lite-android/*.apk | |
fw-lite-android/*.aab | |
- name: Invalidate Lexbox Release endpoint | |
continue-on-error: true | |
run: | | |
sleep 10 | |
curl -X POST https://lexbox.org/api/fwlite-release/new-release | |