feat: Update build workflows for Catalog Lite and Windows Avalonia with improved input types and release handling
Some checks failed
Build Windows Avalonia / build (push) Failing after 1m43s
Some checks failed
Build Windows Avalonia / build (push) Failing after 1m43s
This commit is contained in:
parent
50f0209eb9
commit
3fea86fa78
3 changed files with 185 additions and 90 deletions
|
|
@ -7,10 +7,12 @@ on:
|
|||
description: Catalog Lite expiration date, yyyy-MM-dd
|
||||
required: true
|
||||
default: '2026-12-31'
|
||||
type: string
|
||||
publish_release:
|
||||
description: Publish Forgejo release when running on a tag ref
|
||||
required: true
|
||||
default: 'false'
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
env:
|
||||
DOTNET_VERSION: 10.0.x
|
||||
|
|
@ -92,7 +94,7 @@ jobs:
|
|||
if-no-files-found: error
|
||||
|
||||
release:
|
||||
if: ${{ inputs.publish_release == 'true' && startsWith(github.ref, 'refs/tags/') }}
|
||||
if: inputs.publish_release && startsWith(forgejo.ref, 'refs/tags/')
|
||||
needs: build
|
||||
runs-on: docker
|
||||
env:
|
||||
|
|
@ -122,8 +124,8 @@ jobs:
|
|||
- name: Create or update release
|
||||
run: |
|
||||
set -eu
|
||||
api_base="${GITHUB_SERVER_URL%/}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
tag="${GITHUB_REF_NAME}"
|
||||
api_base="${FORGEJO_SERVER_URL%/}/api/v1/repos/${FORGEJO_REPOSITORY}"
|
||||
tag="${FORGEJO_REF_NAME}"
|
||||
create_payload="$(printf '{"tag_name":"%s","name":"%s","body":"Catalog Lite\\n\\nScadenza build: %s","draft":false,"prerelease":false}' "${tag}" "${tag}" "${CATALOG_LITE_EXPIRATION_DATE}")"
|
||||
update_payload="$(printf '{"body":"Catalog Lite\\n\\nScadenza build: %s"}' "${CATALOG_LITE_EXPIRATION_DATE}")"
|
||||
|
||||
|
|
@ -166,8 +168,8 @@ jobs:
|
|||
- name: Upload release assets
|
||||
run: |
|
||||
set -eu
|
||||
api_base="${GITHUB_SERVER_URL%/}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
short_sha="$(printf '%s' "${GITHUB_SHA}" | cut -c1-12)"
|
||||
api_base="${FORGEJO_SERVER_URL%/}/api/v1/repos/${FORGEJO_REPOSITORY}"
|
||||
short_sha="$(printf '%s' "${FORGEJO_SHA}" | cut -c1-12)"
|
||||
|
||||
windows_exe="$(find artifacts/release/win-x64 -maxdepth 1 -type f -iname '*.exe' | head -n1)"
|
||||
linux_exe="$(find artifacts/release/linux-x64 -maxdepth 1 -type f -name 'CatalogLite' | head -n1)"
|
||||
|
|
@ -182,7 +184,7 @@ jobs:
|
|||
exit 1
|
||||
fi
|
||||
|
||||
linux_archive="CatalogLite-linux-x64-${GITHUB_REF_NAME}-${short_sha}.tar.gz"
|
||||
linux_archive="CatalogLite-linux-x64-${FORGEJO_REF_NAME}-${short_sha}.tar.gz"
|
||||
tar -czf "${linux_archive}" -C "$(dirname "${linux_exe}")" "$(basename "${linux_exe}")"
|
||||
|
||||
upload_asset() {
|
||||
|
|
@ -195,5 +197,5 @@ jobs:
|
|||
"${api_base}/releases/${RELEASE_ID}/assets?name=${asset_name}"
|
||||
}
|
||||
|
||||
upload_asset "${windows_exe}" "CatalogLite-win-x64-${GITHUB_REF_NAME}-${short_sha}.exe"
|
||||
upload_asset "${linux_archive}" "${linux_archive}"
|
||||
upload_asset "${windows_exe}" "CatalogLite-win-x64-${FORGEJO_REF_NAME}-${short_sha}.exe"
|
||||
upload_asset "${linux_archive}" "${linux_archive}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue