fix(ci): publish desktop installers via Gitea Release, not upload-artifact
actions/upload-artifact@v4's backend fails on the Gitea runner (Upload installers
step errored). Mirror release.yml's proven path instead: curl + the built-in token
to the Releases API, into a ROLLING per-branch prerelease (tag desktop-<branch>,
deleted+recreated each push). Installers renamed space-free
(parking-desktop-<branch>-<sha>.{deb,AppImage}). Signed v* releases unchanged.
Claude-Session: https://claude.ai/code/session_01Xcm6ikLgGoCxxHrxtjkk5V
This commit is contained in:
@@ -81,17 +81,54 @@ jobs:
|
||||
|
||||
- name: Collect installers
|
||||
id: collect
|
||||
# Copy out the two installers under SPACE-FREE names (tauri names them
|
||||
# "Parking System_0.0.0_amd64.deb" — spaces break asset URLs). Short SHA in the
|
||||
# name so a downloaded file is traceable to its commit.
|
||||
run: |
|
||||
set -e
|
||||
BUNDLE=apps/desktop/src-tauri/target/release/bundle
|
||||
SHA="$(echo "${GITHUB_SHA}" | cut -c1-7)"
|
||||
mkdir -p dist
|
||||
find "$BUNDLE" \( -name '*.AppImage' -o -name '*.deb' \) -exec cp {} dist/ \;
|
||||
deb=$(find "$BUNDLE/deb" -name '*.deb' | head -1)
|
||||
app=$(find "$BUNDLE/appimage" -name '*.AppImage' | head -1)
|
||||
cp "$deb" "dist/parking-desktop-${GITHUB_REF_NAME}-${SHA}.deb"
|
||||
cp "$app" "dist/parking-desktop-${GITHUB_REF_NAME}-${SHA}.AppImage"
|
||||
echo "Artifacts:"; ls -la dist/
|
||||
|
||||
- name: Upload installers
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: desktop-${{ github.ref_name }}-${{ github.sha }}
|
||||
path: dist/*
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
- name: Publish to a rolling per-branch pre-release
|
||||
# actions/upload-artifact's backend isn't reliable on this Gitea runner, so we
|
||||
# publish to a Gitea RELEASE via the API instead (the proven pattern from
|
||||
# release.yml — built-in token, plain curl). One ROLLING pre-release per branch
|
||||
# (tag desktop-<branch>): delete + recreate each push so it always holds the
|
||||
# latest dev/main installer. This is NOT the signed updater release (release.yml,
|
||||
# tag v*) — it's a prerelease, unsigned, with no latest.json.
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
API: ${{ github.api_url }}
|
||||
REPO: ${{ github.repository }}
|
||||
TAG: desktop-${{ github.ref_name }}
|
||||
run: |
|
||||
set -e
|
||||
auth="Authorization: token ${TOKEN}"
|
||||
# Drop any existing rolling release for this branch (ignore if absent) so its
|
||||
# tag + stale assets don't pile up; recreate it fresh below.
|
||||
OLD=$(curl -sS -H "$auth" "${API}/repos/${REPO}/releases/tags/${TAG}" \
|
||||
| grep -o '"id":[0-9]*' | head -1 | cut -d: -f2 || true)
|
||||
if [ -n "$OLD" ]; then
|
||||
curl -sS -X DELETE -H "$auth" "${API}/repos/${REPO}/releases/${OLD}" || true
|
||||
# Also delete the tag itself so the recreate points at this commit.
|
||||
curl -sS -X DELETE -H "$auth" "${API}/repos/${REPO}/git/refs/tags/${TAG}" || true
|
||||
fi
|
||||
REL=$(curl -sS -X POST -H "$auth" -H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"${TAG}\",\"target_commitish\":\"${GITHUB_SHA}\",\"name\":\"Desktop build (${GITHUB_REF_NAME})\",\"body\":\"Unsigned per-commit desktop installers from ${GITHUB_REF_NAME} @ ${GITHUB_SHA}. Rolling — overwritten each push. Not an updater release.\",\"draft\":false,\"prerelease\":true}" \
|
||||
"${API}/repos/${REPO}/releases")
|
||||
REL_ID=$(printf '%s' "$REL" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||
echo "release id: ${REL_ID}"
|
||||
for f in dist/*; do
|
||||
name=$(basename "$f")
|
||||
echo "uploading ${name}"
|
||||
curl -sS -X POST -H "$auth" -H "Content-Type: application/octet-stream" \
|
||||
--data-binary @"${f}" \
|
||||
"${API}/repos/${REPO}/releases/${REL_ID}/assets?name=${name}" >/dev/null
|
||||
done
|
||||
echo "done"
|
||||
|
||||
Reference in New Issue
Block a user