From 9c454c354b75b0aaaf782ee3b9f92b7fd2893b7b Mon Sep 17 00:00:00 2001 From: Kevin Hahn Date: Thu, 19 Dec 2024 15:00:07 +0700 Subject: [PATCH] build android --- .github/workflows/fw-lite.yaml | 66 +++++++++++++++++++++++++--------- 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/.github/workflows/fw-lite.yaml b/.github/workflows/fw-lite.yaml index bb01e7c9b..c863d458c 100644 --- a/.github/workflows/fw-lite.yaml +++ b/.github/workflows/fw-lite.yaml @@ -19,7 +19,8 @@ on: branches: - develop - main - +env: + VIEWER_BUILD_OUTPUT_DIR: backend/FwLite/FwLiteShared/wwwroot/viewer jobs: build-and-test: name: Build FW Lite and run tests @@ -70,9 +71,9 @@ jobs: - name: Upload viewer artifacts uses: actions/upload-artifact@v4 with: - name: fw-lite-viewer-app + name: fw-lite-viewer-js if-no-files-found: error - path: frontend/viewer/dist + path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} publish-mac: name: Publish FW Lite app for Mac @@ -86,8 +87,8 @@ jobs: submodules: true - uses: actions/download-artifact@v4 with: - name: fw-lite-viewer-app - path: frontend/viewer/dist + name: fw-lite-viewer-js + path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} - uses: actions/setup-dotnet@v4 with: dotnet-version: '9.x' @@ -123,16 +124,12 @@ jobs: submodules: true - uses: actions/download-artifact@v4 with: - name: fw-lite-viewer-app - path: frontend/viewer/dist + 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/LocalWebApp - run: dotnet build --configuration Release - - name: Publish Linux working-directory: backend/FwLite/LocalWebApp run: dotnet publish -r linux-x64 --artifacts-path ../artifacts -p:PublishSingleFile=true -p:Version=${{ needs.build-and-test.outputs.semver-version }} @@ -144,6 +141,38 @@ jobs: if-no-files-found: error path: backend/FwLite/artifacts/publish/LocalWebApp/* + publish-android: + name: Publish FW Lite app for Android + 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: Setup Maui + run: dotnet workload install maui-android + + - name: Publish Android + working-directory: backend/FwLite/FwLiteDesktop + 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/FwLiteDesktop/*/* + publish-win: name: Publish FW Lite app for Windows needs: build-and-test @@ -156,8 +185,8 @@ jobs: submodules: true - uses: actions/download-artifact@v4 with: - name: fw-lite-viewer-app - path: frontend/viewer/dist + name: fw-lite-viewer-js + path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} - uses: actions/setup-dotnet@v4 with: dotnet-version: '9.x' @@ -165,10 +194,6 @@ jobs: - name: Setup Maui run: dotnet workload install maui-windows - - name: Dotnet build - working-directory: backend/FwLite/LocalWebApp - run: dotnet build --configuration Release - - name: Publish Windows MAUI portable app working-directory: backend/FwLite/FwLiteDesktop run: | @@ -239,6 +264,10 @@ jobs: with: name: fw-lite-local-web-app-linux path: fw-lite-local-web-app-linux + - uses: actions/download-artifact@v4 + with: + name: fw-lite-android + path: fw-lite-android - name: Zip artifacts run: | @@ -256,6 +285,9 @@ jobs: fw-lite-msix/* fw-lite-portable.zip fw-lite-local-web-app-linux.zip + fw-lite-android/*.apk + fw-lite-android/*.aab + - name: Invalidate Lexbox Release endpoint continue-on-error: true run: |