ymf
This commit is contained in:
parent
77bbc87a1a
commit
a3ba704882
@ -78,28 +78,13 @@ jobs:
|
||||
REPO_NAME="${{ github.event.repository.name }}"
|
||||
GITEA_URL="${{ github.server_url }}"
|
||||
|
||||
# Prepare release body in a file to avoid escaping issues
|
||||
MANIFEST_URL="${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/raw/branch/master/manifest.json"
|
||||
cat > /tmp/release_body.txt << EOF
|
||||
Jellypod Jellyfin Plugin ${{ steps.get_version.outputs.version }}
|
||||
|
||||
See attached files for plugin installation.
|
||||
|
||||
To install, add this repository URL to Jellyfin:
|
||||
${MANIFEST_URL}
|
||||
EOF
|
||||
|
||||
# Create release using Gitea API with jq for proper JSON
|
||||
# Create release using Gitea API
|
||||
VERSION="${{ steps.get_version.outputs.version }}"
|
||||
RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases" \
|
||||
-d "$(jq -n \
|
||||
--arg tag "${{ steps.get_version.outputs.version }}" \
|
||||
--arg name "Release ${{ steps.get_version.outputs.version }}" \
|
||||
--rawfile body /tmp/release_body.txt \
|
||||
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}'
|
||||
)")
|
||||
-d "$(jq -n --arg tag "$VERSION" --arg name "Release $VERSION" --arg body "Jellypod Jellyfin Plugin. See attached files for plugin installation." '{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')")
|
||||
|
||||
HTTP_CODE=$(echo "$RESPONSE" | tail -n1)
|
||||
BODY=$(echo "$RESPONSE" | sed '$d')
|
||||
@ -154,21 +139,15 @@ jobs:
|
||||
git fetch origin master
|
||||
git checkout master
|
||||
|
||||
# Create new version entry
|
||||
NEW_VERSION=$(cat <<EOF
|
||||
{
|
||||
"version": "${VERSION}",
|
||||
"changelog": "Release ${VERSION}",
|
||||
"targetAbi": "10.9.0.0",
|
||||
"sourceUrl": "${DOWNLOAD_URL}",
|
||||
"checksum": "${CHECKSUM}",
|
||||
"timestamp": "${TIMESTAMP}"
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
# Update manifest.json - prepend new version to versions array
|
||||
jq --argjson newver "${NEW_VERSION}" '.[0].versions = [$newver] + .[0].versions' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
|
||||
jq --arg ver "${VERSION}" \
|
||||
--arg changelog "Release ${VERSION}" \
|
||||
--arg abi "10.9.0.0" \
|
||||
--arg url "${DOWNLOAD_URL}" \
|
||||
--arg checksum "${CHECKSUM}" \
|
||||
--arg ts "${TIMESTAMP}" \
|
||||
'.[0].versions = [{version: $ver, changelog: $changelog, targetAbi: $abi, sourceUrl: $url, checksum: $checksum, timestamp: $ts}] + .[0].versions' \
|
||||
manifest.json > manifest.tmp && mv manifest.tmp manifest.json
|
||||
|
||||
# Commit and push
|
||||
git add manifest.json
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user