Publish Windows installer package
This commit is contained in:
@@ -18,6 +18,7 @@ jobs:
|
|||||||
MODRINTH_API_URL_V3: https://api.modrinth.com/v3/
|
MODRINTH_API_URL_V3: https://api.modrinth.com/v3/
|
||||||
MODRINTH_SOCKET_URL: wss://api.modrinth.com/
|
MODRINTH_SOCKET_URL: wss://api.modrinth.com/
|
||||||
MODRINTH_LAUNCHER_META_URL: https://launcher-meta.modrinth.com/
|
MODRINTH_LAUNCHER_META_URL: https://launcher-meta.modrinth.com/
|
||||||
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
XWIN_CACHE_DIR: .xwin-cache
|
XWIN_CACHE_DIR: .xwin-cache
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -71,3 +72,36 @@ jobs:
|
|||||||
name: modrinth-plus-windows
|
name: modrinth-plus-windows
|
||||||
path: target/x86_64-pc-windows-msvc/release/bundle/nsis/**
|
path: target/x86_64-pc-windows-msvc/release/bundle/nsis/**
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Publish Windows client to Gitea package registry
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
app_version="$(node -p "require('./apps/app-frontend/package.json').version")"
|
||||||
|
package_version="${app_version}-${GITHUB_SHA::7}"
|
||||||
|
package_name="modrinth-plus"
|
||||||
|
latest_url="https://git.wilkensxl.de/api/packages/MrSphay/generic/${package_name}/latest"
|
||||||
|
|
||||||
|
shopt -s nullglob
|
||||||
|
artifacts=(target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe)
|
||||||
|
if [ "${#artifacts[@]}" -eq 0 ]; then
|
||||||
|
echo "No Windows installer found to publish"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for artifact in "${artifacts[@]}"; do
|
||||||
|
file_name="$(basename "$artifact")"
|
||||||
|
curl --fail-with-body \
|
||||||
|
--user "MrSphay:${REGISTRY_TOKEN}" \
|
||||||
|
--upload-file "$artifact" \
|
||||||
|
"https://git.wilkensxl.de/api/packages/MrSphay/generic/${package_name}/${package_version}/${file_name}"
|
||||||
|
done
|
||||||
|
|
||||||
|
curl --silent --show-error --user "MrSphay:${REGISTRY_TOKEN}" --request DELETE "${latest_url}" || true
|
||||||
|
|
||||||
|
mkdir -p package-latest
|
||||||
|
cp "${artifacts[0]}" "package-latest/Modrinth-Plus-Windows-Setup.exe"
|
||||||
|
|
||||||
|
curl --fail-with-body \
|
||||||
|
--user "MrSphay:${REGISTRY_TOKEN}" \
|
||||||
|
--upload-file "package-latest/Modrinth-Plus-Windows-Setup.exe" \
|
||||||
|
"${latest_url}/Modrinth-Plus-Windows-Setup.exe"
|
||||||
|
|||||||
Reference in New Issue
Block a user