feat: Enhance Windows build and release workflows with packaging and validation for CUDA runtime libraries
Some checks failed
Build Windows Avalonia / build (push) Failing after 2m26s

This commit is contained in:
Maddo 2026-12-03 20:06:06 +01:00
commit a883daf068
4 changed files with 107 additions and 20 deletions

View file

@ -9,6 +9,7 @@ env:
DOTNET_VERSION: 10.0.x
PROJECT_PATH: imagecatalog/ImageCatalog 2.csproj
PUBLISH_DIR: artifacts/publish/win-x64
PACKAGE_PATH: artifacts/publish/ImageCatalog-avalonia-win-x64.zip
ARTIFACT_NAME: imagecatalog-windows-avalonia
NUGET_SOURCE_NAME: Nuget-Forgejo-AIFotoONLUS
NUGET_SOURCE_URL: ${{ vars.AIFOTOONLUS_NUGET_SOURCE_URL || format('{0}/api/packages/{1}/nuget/index.json', forgejo.server_url, vars.AIFOTOONLUS_PACKAGE_OWNER || forgejo.repository_owner) }}
@ -62,6 +63,8 @@ jobs:
- name: Publish Windows Avalonia build
run: |
set -eu
publish_dir="${GITHUB_WORKSPACE}/${{ env.PUBLISH_DIR }}"
rm -rf "${publish_dir}"
dotnet publish "${{ env.PROJECT_PATH }}" \
-c Release \
-r win-x64 \
@ -71,7 +74,7 @@ jobs:
-p:PublishSingleFile=true \
-p:PublishTrimmed=false \
-p:PublishReadyToRun=false \
-o "${{ env.PUBLISH_DIR }}"
-o "${publish_dir}"
- name: Validate published executable
run: |
@ -89,11 +92,20 @@ jobs:
exit 1
fi
- name: Package complete Windows release
run: |
set -eu
dotnet msbuild "${{ env.PROJECT_PATH }}" \
-target:PackageWindowsCatalogOutput \
-p:PublishDir="${GITHUB_WORKSPACE}/${{ env.PUBLISH_DIR }}" \
-p:PublishArchivePath="${GITHUB_WORKSPACE}/${{ env.PACKAGE_PATH }}"
test -s "${GITHUB_WORKSPACE}/${{ env.PACKAGE_PATH }}"
- name: Upload publish artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.PUBLISH_DIR }}
path: ${{ env.PACKAGE_PATH }}
if-no-files-found: error
release:
@ -153,22 +165,22 @@ jobs:
echo "RELEASE_ID=${release_id}" >> "${GITHUB_ENV}"
- name: Upload executable to release
- name: Upload Windows distributable ZIP to release
run: |
set -eu
api_base="${FORGEJO_SERVER_URL%/}/api/v1/repos/${FORGEJO_REPOSITORY}"
executable_path="$(find artifacts/release -maxdepth 1 -type f -iname '*.exe' | head -n1)"
archive_path="$(find artifacts/release -maxdepth 1 -type f -iname '*.zip' | head -n1)"
if [ -z "${executable_path}" ]; then
echo "No executable found in downloaded artifact"
if [ -z "${archive_path}" ]; then
echo "No Windows distributable ZIP found in downloaded artifact"
exit 1
fi
short_sha="$(printf '%s' "${FORGEJO_SHA}" | cut -c1-12)"
asset_name="ImageCatalog-avalonia-win-x64-${FORGEJO_REF_NAME}-${short_sha}.exe"
asset_name="ImageCatalog-avalonia-win-x64-${FORGEJO_REF_NAME}-${short_sha}.zip"
curl -fsS \
-H "Authorization: token ${FORGEJO_TOKEN}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"${executable_path}" \
--data-binary @"${archive_path}" \
"${api_base}/releases/${RELEASE_ID}/assets?name=${asset_name}"