Once more, with feeling (I hate git actions).
All checks were successful
Release / tag-and-release (push) Successful in 1m12s

This commit is contained in:
2025-09-12 16:12:00 +01:00
parent b9524dbe73
commit 41b5122e12

View File

@@ -39,57 +39,18 @@ jobs:
dotnet restore
dotnet build --configuration Release --no-restore
- name: Prepare Club Penguin
- name: Prepare Club Penguin Repo
run: |
mkdir -p output
cp MareSynchronos/bin/x64/Release/ClubPenguinSync/latest.zip output/ClubPenguinSync-${{ gitea.ref_name }}.zip
mv MareSynchronos/bin/x64/Release/ClubPenguinSync/latest.zip /repo/download/ClubPenguinSync-${{ gitea.ref_name }}.zip
- name: Create Release
id: create_release
run: |
echo "=== Searching for existing release ${{ gitea.ref_name }}==="
release_id=$(curl -s -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"https://git.drgn.rocks/api/v1/repos/${GITHUB_REPOSITORY}/releases/tags/${{ gitea.ref_name }}" | jq -r .id)
if [ "$release_id" != "null" ]; then
echo "=== Deleting existing release ${{ gitea.ref_name }}==="
curl -X DELETE -H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
"https://git.drgn.rocks/api/v1/repos/${GITHUB_REPOSITORY}/releases/$release_id"
fi
echo "=== Creating new release ${{ gitea.ref_name }}==="
response=$(
curl --fail-with-body -X POST \
-H "Content-Type: application/json" \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-d '{
"tag_name": "${{ gitea.ref_name }}",
"name": "${{ gitea.ref_name }}",
"draft": false,
"prerelease": false
}' \
"https://git.drgn.rocks/api/v1/repos/${GITHUB_REPOSITORY}/releases"
)
release_id=$(echo "$response" | jq -r .id)
echo "release_id=$release_id" >> "$GITHUB_OUTPUT"
- name: Upload Assets to release
run: |
curl --fail-with-body -s -X POST \
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
-F "attachment=@output/ClubPenguinSync-${{ gitea.ref_name }}.zip" \
"https://git.drgn.rocks/api/v1/repos/${GITHUB_REPOSITORY}/releases/${{ steps.create_release.outputs.release_id }}/assets"
- name: Update repo.json with version
env:
VERSION: ${{ gitea.ref_name }}
run: |
set -e
pluginJsonPath="${PLUGIN_NAME}/bin/x64/Release/${PLUGIN_NAME}.json"
pluginJsonPath="MareSynchronos/bin/x64/Release/${PLUGIN_NAME}.json"
repoJsonPath="/repo/repo.json"
version="${VERSION}"
downloadUrl="https://clubpenguin.drgn.rocks/download/ClubPenguinSync-${{ gitea.ref_name }}.zip"