Release body with arch-detecting install one-liner
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -48,12 +48,29 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
TAG="latest"
|
TAG="latest"
|
||||||
BODY="Rullande bygge från senaste master. Commit: ${{ github.sha }}. Arkitekturer: linux x64 + arm64 (Pi5)."
|
BASE="https://gitea.brasse-pc.eu/$REPO/releases/download/$TAG"
|
||||||
|
BODY=$(cat <<EOF
|
||||||
|
Rullande bygge från senaste master. Commit: ${{ github.sha }}. Arkitekturer: linux x64 + arm64 (Pi5).
|
||||||
|
|
||||||
|
## Installera / uppdatera
|
||||||
|
|
||||||
|
\`\`\`bash
|
||||||
|
mkdir -p ~/.local/bin && curl -fsSL "$BASE/tui-fm-linux-\$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/')" -o ~/.local/bin/tui-fm && chmod +x ~/.local/bin/tui-fm
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
Kör sedan \`tui-fm\` (se till att \`~/.local/bin\` finns i \$PATH).
|
||||||
|
EOF
|
||||||
|
)
|
||||||
rid=$(curl -s -X POST "$API/repos/$REPO/releases" \
|
rid=$(curl -s -X POST "$API/repos/$REPO/releases" \
|
||||||
-H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
-H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"body\":\"$BODY\"}" | jq -r '.id // empty')
|
-d "$(jq -n --arg tag "$TAG" --arg body "$BODY" '{tag_name:$tag,name:$tag,body:$body}')" | jq -r '.id // empty')
|
||||||
[ -z "$rid" ] && rid=$(curl -s "$API/repos/$REPO/releases/tags/$TAG" \
|
if [ -z "$rid" ]; then
|
||||||
-H "Authorization: token $TOKEN" | jq -r '.id')
|
rid=$(curl -s "$API/repos/$REPO/releases/tags/$TAG" \
|
||||||
|
-H "Authorization: token $TOKEN" | jq -r '.id')
|
||||||
|
curl -s -X PATCH "$API/repos/$REPO/releases/$rid" \
|
||||||
|
-H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||||
|
-d "$(jq -n --arg body "$BODY" '{body:$body}')" -o /dev/null
|
||||||
|
fi
|
||||||
echo "release id: $rid"
|
echo "release id: $rid"
|
||||||
for f in tui-fm-linux-x64 tui-fm-linux-arm64 checksums.txt; do
|
for f in tui-fm-linux-x64 tui-fm-linux-arm64 checksums.txt; do
|
||||||
aid=$(curl -s "$API/repos/$REPO/releases/$rid/assets" \
|
aid=$(curl -s "$API/repos/$REPO/releases/$rid/assets" \
|
||||||
|
|||||||
Reference in New Issue
Block a user