|
8 | 8 | BUILD_COMMAND: |
9 | 9 | description: "The flutter build command to run to generate assets for the deployment build" |
10 | 10 | required: false |
11 | | - default: "flutter build web --no-pub --release" |
| 11 | + default: "flutter build web --no-pub --release --wasm" |
12 | 12 |
|
13 | 13 | # Optional Trello feedback provider configuration |
14 | 14 | TRELLO_API_KEY: |
|
72 | 72 | fi |
73 | 73 | # Export for subsequent steps |
74 | 74 | echo "COMMIT_HASH=$COMMIT_HASH" >> $GITHUB_ENV |
| 75 | + BUILD_DATE=$(date -u '+%Y-%m-%dT%H:%MZ') |
| 76 | + echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV |
75 | 77 | - name: Fetch packages and generate assets |
76 | 78 | id: fetch_and_build |
77 | 79 | shell: bash |
@@ -101,8 +103,9 @@ runs: |
101 | 103 | # Prepare build command with feedback service credentials |
102 | 104 | BUILD_CMD="${{ inputs.BUILD_COMMAND }}" |
103 | 105 |
|
104 | | - # Add commit hash to build command |
| 106 | + # Add commit hash and build date to build command |
105 | 107 | BUILD_CMD="$BUILD_CMD --dart-define=COMMIT_HASH=$COMMIT_HASH" |
| 108 | + BUILD_CMD="$BUILD_CMD --dart-define=BUILD_DATE=$BUILD_DATE" |
106 | 109 |
|
107 | 110 | # Check and add the shared Trello board and list IDs if they are available |
108 | 111 | HAVE_TRELLO_IDS=false |
@@ -155,13 +158,14 @@ runs: |
155 | 158 | BUILD_CMD="$BUILD_CMD --dart-define=CI=true --dart-define=ANALYTICS_DISABLED=true" |
156 | 159 | fi |
157 | 160 |
|
158 | | - # Run flutter build once to download coin icons and config files. |
159 | | - # This step is expected to "fail", since flutter build has to run again |
160 | | - # after the assets are downloaded to register them in AssetManifest.bin |
| 161 | + # Run flutter build once to download coin icons and config files. |
| 162 | + # The second build must re-register them in AssetManifest.bin, so we |
| 163 | + # wipe the build directory afterwards -- but preserve native_assets |
| 164 | + # which desktop builds generate and need to reuse. |
161 | 165 | echo "" |
162 | 166 | flutter pub get --enforce-lockfile > /dev/null 2>&1 || true |
163 | 167 | $BUILD_CMD > /dev/null 2>&1 || true |
164 | | - rm -rf build/* |
| 168 | + find build -mindepth 1 -maxdepth 1 ! -name 'native_assets' -exec rm -rf {} + 2>/dev/null || true |
165 | 169 |
|
166 | 170 | # Run flutter build and capture its output |
167 | 171 | flutter pub get --enforce-lockfile |
|
0 commit comments