|
| 1 | +name: FieldWorks Lite for iOS (temporary for build testing) |
| 2 | +on: |
| 3 | + workflow_dispatch: |
| 4 | + push: |
| 5 | + paths: |
| 6 | + - 'backend/FwLite/**' |
| 7 | + - 'backend/harmony/**' |
| 8 | + - 'frontend/viewer/**' |
| 9 | + - '.github/workflows/fw-lite.yaml' |
| 10 | + - 'FwLiteOnly.slnf' |
| 11 | + branches: |
| 12 | + - develop |
| 13 | + - main |
| 14 | + pull_request: |
| 15 | + paths: |
| 16 | + - 'backend/FwLite/**' |
| 17 | + - 'backend/harmony/**' |
| 18 | + - 'frontend/viewer/**' |
| 19 | + - '.github/workflows/fw-lite.yaml' |
| 20 | + - 'FwLiteOnly.slnf' |
| 21 | + branches: |
| 22 | + - develop |
| 23 | + - main |
| 24 | +env: |
| 25 | + VIEWER_BUILD_OUTPUT_DIR: backend/FwLite/FwLiteShared/wwwroot/viewer |
| 26 | +jobs: |
| 27 | + build-and-test: |
| 28 | + name: Build FW Lite and run tests |
| 29 | + timeout-minutes: 40 |
| 30 | + runs-on: windows-latest |
| 31 | + outputs: |
| 32 | + version: ${{ steps.setVersion.outputs.VERSION }} |
| 33 | + semver-version: ${{ steps.setVersion.outputs.SEMVER_VERSION }} |
| 34 | + steps: |
| 35 | + - name: Checkout |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: true |
| 39 | + - uses: actions/setup-dotnet@v4 |
| 40 | + with: |
| 41 | + dotnet-version: '9.x' |
| 42 | + - uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 |
| 43 | + with: |
| 44 | + package_json_file: 'frontend/package.json' |
| 45 | + - uses: actions/setup-node@v4 |
| 46 | + with: |
| 47 | + node-version-file: './frontend/package.json' |
| 48 | + cache: 'pnpm' |
| 49 | + cache-dependency-path: './frontend/pnpm-lock.yaml' |
| 50 | + - name: Install Task |
| 51 | + uses: arduino/setup-task@b91d5d2c96a56797b48ac1e0e89220bf64044611 #v2 |
| 52 | + with: |
| 53 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + |
| 55 | + - name: Set Version |
| 56 | + id: setVersion |
| 57 | + shell: bash |
| 58 | + # set version to date in vYYYY-MM-DD-commitSha format, and semver version to YYYY.MM.DD |
| 59 | + run: | |
| 60 | + shortSha=$(echo ${{ github.sha }} | cut -c1-8) |
| 61 | + echo "VERSION=v$(date --rfc-3339=date)-$shortSha" >> ${GITHUB_OUTPUT} |
| 62 | + echo "SEMVER_VERSION=$(date +%Y.%-m.%-d)" >> ${GITHUB_OUTPUT} |
| 63 | +
|
| 64 | + - name: Check for pending EF model changes |
| 65 | + run: task fw-lite:has-pending-model-changes |
| 66 | + |
| 67 | + - name: Prepare frontend |
| 68 | + working-directory: frontend |
| 69 | + run: | |
| 70 | + pnpm install |
| 71 | + pnpm svelte-kit sync |
| 72 | +
|
| 73 | + - name: Build viewer |
| 74 | + working-directory: frontend/viewer |
| 75 | + run: pnpm run build-app |
| 76 | + |
| 77 | + - name: Upload viewer artifacts |
| 78 | + uses: actions/upload-artifact@v4 |
| 79 | + with: |
| 80 | + name: fw-lite-viewer-js |
| 81 | + if-no-files-found: error |
| 82 | + path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} |
| 83 | + |
| 84 | + publish-ios: |
| 85 | + name: Publish FW Lite app for iOS |
| 86 | + needs: build-and-test |
| 87 | + timeout-minutes: 30 |
| 88 | + runs-on: macos-latest |
| 89 | + env: |
| 90 | + APPLE_CERTIFICATE: ${{ secrets.SIL_APPLE_DISTRIBUTION_CERTIFICATE_BASE64 }} |
| 91 | + APP_STORE_CONNECT_KEY_ID: ${{ secrets.APPLE_APPSTORECONNECT_KEY_ID }} |
| 92 | + APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APPLE_APPSTORECONNECT_ISSUER_ID }} |
| 93 | + APP_STORE_CONNECT_PRIVATE_KEY: ${{ secrets.APPLE_APPSTORECONNECT_PRIVATE_KEY }} |
| 94 | + |
| 95 | + steps: |
| 96 | + - name: Checkout |
| 97 | + uses: actions/checkout@v4 |
| 98 | + with: |
| 99 | + submodules: true |
| 100 | + - uses: actions/download-artifact@v4 |
| 101 | + with: |
| 102 | + name: fw-lite-viewer-js |
| 103 | + path: ${{ env.VIEWER_BUILD_OUTPUT_DIR }} |
| 104 | + - uses: actions/setup-dotnet@v4 |
| 105 | + with: |
| 106 | + dotnet-version: '9.x' |
| 107 | + - uses: maui-actions/apple-provisioning@v4 |
| 108 | + with: |
| 109 | + certificate: APPLE_CERTIFICATE |
| 110 | + certificate-passphrase: ${{ secrets.SIL_APPLE_DISTRIBUTION_CERTIFICATE_PASSPHRASE }} |
| 111 | + bundle-identifiers: 'org.sil.FwLiteMaui' |
| 112 | + profile-types: 'IOS_APP_STORE' |
| 113 | + |
| 114 | + - name: Setup Maui |
| 115 | + run: dotnet workload install maui |
| 116 | + |
| 117 | + - name: Publish iOS |
| 118 | + working-directory: backend/FwLite/FwLiteMaui |
| 119 | + run: dotnet publish -f net9.0-ios --artifacts-path ../artifacts |
| 120 | + |
| 121 | + - name: Upload FWLite App artifacts |
| 122 | + uses: actions/upload-artifact@v4 |
| 123 | + with: |
| 124 | + name: fw-lite-ios |
| 125 | + if-no-files-found: error |
| 126 | +# path looks like this: backend/FwLite/artifacts/publish/FwLiteMaui/release_net9.0-android/org.sil.fwlitemaui-signed.apk |
| 127 | + path: backend/FwLite/artifacts/publish/* |
0 commit comments