|
75 | 75 | echo "RELEASE_VERSION=${edge_version}" >> "${GITHUB_ENV}" |
76 | 76 | echo "LINUXDO_BUILD_VERSION=${edge_version}" >> "${GITHUB_ENV}" |
77 | 77 | echo "LINUXDO_GIT_HASH=${short_sha}" >> "${GITHUB_ENV}" |
| 78 | + echo "asset_hash=${short_sha}" >> "${GITHUB_OUTPUT}" |
78 | 79 |
|
79 | 80 | - uses: dtolnay/rust-toolchain@stable |
80 | 81 |
|
@@ -129,7 +130,7 @@ jobs: |
129 | 130 | - name: Upload artifacts |
130 | 131 | uses: actions/upload-artifact@v4 |
131 | 132 | with: |
132 | | - name: linuxdo-accelerator-${{ steps.sync_version.outputs.package_version }}-${{ matrix.artifact_name }} |
| 133 | + name: linuxdo-accelerator-${{ steps.sync_version.outputs.asset_hash }}-${{ matrix.artifact_name }} |
133 | 134 | path: | |
134 | 135 | dist/** |
135 | 136 | target/release/linuxdo-accelerator* |
@@ -180,6 +181,7 @@ jobs: |
180 | 181 | echo "RELEASE_VERSION=${edge_version}" >> "${GITHUB_ENV}" |
181 | 182 | echo "LINUXDO_BUILD_VERSION=${edge_version}" >> "${GITHUB_ENV}" |
182 | 183 | echo "LINUXDO_GIT_HASH=${short_sha}" >> "${GITHUB_ENV}" |
| 184 | + echo "asset_hash=${short_sha}" >> "${GITHUB_OUTPUT}" |
183 | 185 |
|
184 | 186 | - uses: actions/setup-java@v4 |
185 | 187 | with: |
@@ -225,15 +227,15 @@ jobs: |
225 | 227 | ANDROID_ABI: ${{ matrix.abi }} |
226 | 228 | RUST_TARGET: ${{ matrix.rust_target }} |
227 | 229 | ANDROID_BUILD_TYPE: release |
228 | | - APK_OUTPUT_NAME: linuxdo-accelerator-${{ steps.sync_version.outputs.package_version }}-android-${{ matrix.abi }}.apk |
| 230 | + APK_OUTPUT_NAME: linuxdo-accelerator-${{ steps.sync_version.outputs.asset_hash }}-android-${{ matrix.abi }}.apk |
229 | 231 | run: | |
230 | 232 | export ANDROID_NDK_HOME="${ANDROID_SDK_ROOT}/ndk/27.2.12479018" |
231 | 233 | ./scripts/build-android-apk.sh |
232 | 234 |
|
233 | 235 | - name: Upload Android artifacts |
234 | 236 | uses: actions/upload-artifact@v4 |
235 | 237 | with: |
236 | | - name: linuxdo-accelerator-${{ steps.sync_version.outputs.package_version }}-${{ matrix.artifact_name }} |
| 238 | + name: linuxdo-accelerator-${{ steps.sync_version.outputs.asset_hash }}-${{ matrix.artifact_name }} |
237 | 239 | path: | |
238 | 240 | android/dist/*.apk |
239 | 241 |
|
@@ -273,17 +275,32 @@ jobs: |
273 | 275 |
|
274 | 276 | git push -f origin "${GITHUB_SHA}:refs/tags/${EDGE_TAG}" |
275 | 277 |
|
276 | | - short_sha="$(git rev-parse --short "${GITHUB_SHA}")" |
| 278 | + short_sha="${GITHUB_SHA::12}" |
277 | 279 | notes_file="$(mktemp)" |
278 | 280 | cat > "${notes_file}" <<EOF |
279 | 281 | Auto-updated from main. |
280 | 282 |
|
281 | 283 | Commit: ${short_sha} |
282 | 284 | Run: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID} |
283 | 285 | EOF |
284 | | - mapfile -t release_files < <( |
285 | | - find release-artifacts -type f \( -path '*/dist/*' -o -name '*.apk' \) | sort |
| 286 | + asset_hash="${GITHUB_SHA::12}" |
| 287 | + release_assets_dir="$(mktemp -d)" |
| 288 | + while IFS= read -r -d '' file; do |
| 289 | + rel_path="${file#release-artifacts/}" |
| 290 | + artifact_dir="${rel_path%%/*}" |
| 291 | + platform="${artifact_dir#linuxdo-accelerator-${asset_hash}-}" |
| 292 | + case "${file}" in |
| 293 | + *.tar.gz) ext="tar.gz" ;; |
| 294 | + *.AppImage) ext="AppImage" ;; |
| 295 | + *) ext="${file##*.}" ;; |
| 296 | + esac |
| 297 | + cp "${file}" "${release_assets_dir}/linuxdo-accelerator-${asset_hash}-${platform}.${ext}" |
| 298 | + done < <( |
| 299 | + find release-artifacts -type f \ |
| 300 | + \( -name '*.apk' -o -name '*.deb' -o -name '*.dmg' -o -name '*.exe' -o -name '*.msi' -o -name '*.zip' -o -name '*.tar.gz' -o -name '*.AppImage' \) \ |
| 301 | + -print0 | sort -z |
286 | 302 | ) |
| 303 | + mapfile -t release_files < <(find "${release_assets_dir}" -type f | sort) |
287 | 304 | if [[ "${#release_files[@]}" -eq 0 ]]; then |
288 | 305 | echo "no release files found" >&2 |
289 | 306 | exit 1 |
|
0 commit comments