.gitea/workflows/release-nr-mod.yml aktualisiert
This commit is contained in:
@@ -31,17 +31,32 @@ jobs:
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Create Release
|
- name: Create Release
|
||||||
id: create_release
|
|
||||||
uses: softprops/action-gh-release@v1
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
with:
|
run: |
|
||||||
tag_name: ${{ env.RELEASE_TAG }}
|
# Create the release using Gitea API
|
||||||
name: Release ${{ env.RELEASE_TAG }}
|
curl -X POST \
|
||||||
draft: false
|
"https://git.mywebsite.io/api/v1/repos/henrik/pixel9-EU-combos/releases" \
|
||||||
prerelease: false
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
files: |
|
-H "Content-Type: application/json" \
|
||||||
p9_nr_platform_mod_v${{ env.MOD_VERSION }}.zip
|
-d '{
|
||||||
|
"tag_name": "${{ env.RELEASE_TAG }}",
|
||||||
|
"name": "Release ${{ env.RELEASE_TAG }}",
|
||||||
|
"body": "NR Module Release ${{ env.MOD_VERSION }}",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}'
|
||||||
|
|
||||||
|
# Upload the release asset
|
||||||
|
RELEASE_ID=$(curl -s \
|
||||||
|
"https://git.hnrk.io/api/v1/repos/henrik/pixel9-EU-combos/releases/tags/${{ env.RELEASE_TAG }}" \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
|
||||||
|
|
||||||
|
curl -X POST \
|
||||||
|
"https://git.hnrk.io/api/v1/repos/henrik/pixel9-EU-combos/releases/${RELEASE_ID}/assets?name=p9_nr_platform_mod_v${{ env.MOD_VERSION }}.zip" \
|
||||||
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
|
-H "Content-Type: application/zip" \
|
||||||
|
--data-binary @"p9_nr_platform_mod_v${{ env.MOD_VERSION }}.zip"
|
||||||
|
|
||||||
- name: Update updater JSON
|
- name: Update updater JSON
|
||||||
run: |
|
run: |
|
||||||
@@ -49,15 +64,15 @@ jobs:
|
|||||||
{
|
{
|
||||||
"version": "${{ env.MOD_VERSION }}",
|
"version": "${{ env.MOD_VERSION }}",
|
||||||
"versionCode": ${{ env.MOD_VERSIONCODE }},
|
"versionCode": ${{ env.MOD_VERSIONCODE }},
|
||||||
"zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/p9_nr_platform_mod_v${{ env.MOD_VERSION }}.zip",
|
"zipUrl": "https://git.hnrk.io/henrik/pixel9-EU-combos/releases/download/${{ env.RELEASE_TAG }}/p9_nr_platform_mod_v${{ env.MOD_VERSION }}.zip",
|
||||||
"changelog": "https://raw.githubusercontent.com/${{ github.repository }}/main/changelog-NR.md"
|
"changelog": "https://git.hnrk.io/henrik/pixel9-EU-combos/raw/branch/main/changelog-NR.md"
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Commit and push updater JSON
|
- name: Commit and push updater JSON
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "action@github.com"
|
git config --local user.email "action@gitea.com"
|
||||||
git config --local user.name "GitHub Action"
|
git config --local user.name "Gitea Action"
|
||||||
git add updaterNR.json
|
git add updaterNR.json
|
||||||
git commit -m "Update updaterNR.json for version ${{ env.MOD_VERSION }}"
|
git commit -m "Update updaterNR.json for version ${{ env.MOD_VERSION }}"
|
||||||
git push
|
git push
|
||||||
@@ -77,9 +92,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Send to second chat (with error checking)
|
# Send to second chat (with error checking)
|
||||||
if ! curl -s -f -o /dev/null -F document=@"p9_nr_platform_mod_v${{ env.MOD_VERSION }}.zip" \
|
# if ! curl -s -f -o /dev/null -F document=@"p9_nr_platform_mod_v${{ env.MOD_VERSION }}.zip" \
|
||||||
-F caption="New NR Module Release ${{ env.RELEASE_TAG }}" \
|
# -F caption="New NR Module Release ${{ env.RELEASE_TAG }}" \
|
||||||
"https://api.telegram.org/bot${BOT_TOKEN}/sendDocument?chat_id=${CHAT_ID_2}"; then
|
# "https://api.telegram.org/bot${BOT_TOKEN}/sendDocument?chat_id=${CHAT_ID_2}"; then
|
||||||
echo "Failed to send to second chat"
|
# echo "Failed to send to second chat"
|
||||||
exit 1
|
# exit 1
|
||||||
fi
|
# fi
|
||||||
|
|||||||
Reference in New Issue
Block a user