latest make jeelyfin release
This commit is contained in:
parent
462c8a7c7b
commit
3336bac3fb
@ -38,9 +38,19 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
jprm --verbosity=debug plugin build ./
|
jprm --verbosity=debug plugin build ./
|
||||||
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
ARTIFACT=$(find . -name "*.zip" -type f -print -quit | sed 's|^\./||')
|
||||||
|
ARTIFACT_NAME=$(basename "${ARTIFACT}")
|
||||||
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
echo "artifact=${ARTIFACT}" >> $GITHUB_OUTPUT
|
||||||
|
echo "artifact_name=${ARTIFACT_NAME}" >> $GITHUB_OUTPUT
|
||||||
echo "Found artifact: ${ARTIFACT}"
|
echo "Found artifact: ${ARTIFACT}"
|
||||||
|
|
||||||
|
- name: Calculate checksum
|
||||||
|
id: checksum
|
||||||
|
working-directory: build-${{ github.run_id }}
|
||||||
|
run: |
|
||||||
|
CHECKSUM=$(md5sum "${{ steps.jprm.outputs.artifact }}" | awk '{print $1}')
|
||||||
|
echo "checksum=${CHECKSUM}" >> $GITHUB_OUTPUT
|
||||||
|
echo "Checksum: ${CHECKSUM}"
|
||||||
|
|
||||||
- name: Create or update latest release
|
- name: Create or update latest release
|
||||||
working-directory: build-${{ github.run_id }}
|
working-directory: build-${{ github.run_id }}
|
||||||
env:
|
env:
|
||||||
@ -103,10 +113,57 @@ jobs:
|
|||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/zip" \
|
-H "Content-Type: application/zip" \
|
||||||
--data-binary "@${{ steps.jprm.outputs.artifact }}" \
|
--data-binary "@${{ steps.jprm.outputs.artifact }}" \
|
||||||
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=srfplay_latest.zip"
|
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=${{ steps.jprm.outputs.artifact_name }}"
|
||||||
|
|
||||||
|
# Upload build.yaml
|
||||||
|
echo "Uploading build.yaml..."
|
||||||
|
curl -f -X POST \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/x-yaml" \
|
||||||
|
--data-binary "@build.yaml" \
|
||||||
|
"${GITEA_URL}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}/releases/${RELEASE_ID}/assets?name=build.yaml"
|
||||||
|
|
||||||
echo "Latest release updated successfully!"
|
echo "Latest release updated successfully!"
|
||||||
|
|
||||||
|
- name: Update manifest.json
|
||||||
|
working-directory: build-${{ github.run_id }}
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
REPO_OWNER="${{ github.repository_owner }}"
|
||||||
|
REPO_NAME="${{ github.event.repository.name }}"
|
||||||
|
GITEA_URL="${{ github.server_url }}"
|
||||||
|
CHECKSUM="${{ steps.checksum.outputs.checksum }}"
|
||||||
|
ARTIFACT_NAME="${{ steps.jprm.outputs.artifact_name }}"
|
||||||
|
TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
|
||||||
|
DOWNLOAD_URL="${GITEA_URL}/${REPO_OWNER}/${REPO_NAME}/releases/download/latest/${ARTIFACT_NAME}"
|
||||||
|
SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
|
||||||
|
|
||||||
|
git config user.name "Gitea Actions"
|
||||||
|
git config user.email "actions@gitea.tourolle.paris"
|
||||||
|
git fetch origin master
|
||||||
|
git checkout master
|
||||||
|
|
||||||
|
# Remove existing "latest" entry if present, then prepend new one
|
||||||
|
jq --arg url "$DOWNLOAD_URL" 'if .[0].versions[0].changelog == "Latest Build" then .[0].versions = .[0].versions[1:] else . end' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
|
||||||
|
|
||||||
|
NEW_VERSION=$(cat <<EOF
|
||||||
|
{
|
||||||
|
"version": "0.0.0.0",
|
||||||
|
"changelog": "Latest Build",
|
||||||
|
"targetAbi": "10.9.0.0",
|
||||||
|
"sourceUrl": "${DOWNLOAD_URL}",
|
||||||
|
"checksum": "${CHECKSUM}",
|
||||||
|
"timestamp": "${TIMESTAMP}"
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
jq --argjson newver "${NEW_VERSION}" '.[0].versions = [$newver] + .[0].versions' manifest.json > manifest.tmp && mv manifest.tmp manifest.json
|
||||||
|
git add manifest.json
|
||||||
|
git commit -m "Update manifest.json for latest build (${SHORT_SHA})" || echo "No changes to commit"
|
||||||
|
git push origin master
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
if: always()
|
if: always()
|
||||||
run: rm -rf build-${{ github.run_id }}
|
run: rm -rf build-${{ github.run_id }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user