From 25de5e5b08b3f510677a34c41e5cdbf532b306b6 Mon Sep 17 00:00:00 2001 From: Henrik Neef Date: Sun, 16 Nov 2025 12:35:47 +0100 Subject: [PATCH] .gitea/workflows/release-lte-mod.yml aktualisiert --- .gitea/workflows/release-lte-mod.yml | 55 ++++++++++++++++++---------- 1 file changed, 35 insertions(+), 20 deletions(-) diff --git a/.gitea/workflows/release-lte-mod.yml b/.gitea/workflows/release-lte-mod.yml index 78f3b0a..629db1c 100644 --- a/.gitea/workflows/release-lte-mod.yml +++ b/.gitea/workflows/release-lte-mod.yml @@ -31,17 +31,32 @@ jobs: cd .. - name: Create Release - id: create_release - uses: softprops/action-gh-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ env.RELEASE_TAG }} - name: Release ${{ env.RELEASE_TAG }} - draft: false - prerelease: false - files: | - p9_lte_combos_mod_v${{ env.MOD_VERSION }}.zip + GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Create the release using Gitea API + curl -X POST \ + "https://git.mywebsite.io/api/v1/repos/henrik/pixel9-EU-combos/releases" \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -d '{ + "tag_name": "${{ env.RELEASE_TAG }}", + "name": "Release ${{ env.RELEASE_TAG }}", + "body": "LTE 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_lte_combos_mod_v${{ env.MOD_VERSION }}.zip" \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/zip" \ + --data-binary @"p9_lte_combos_mod_v${{ env.MOD_VERSION }}.zip" - name: Update updater JSON run: | @@ -49,15 +64,15 @@ jobs: { "version": "${{ env.MOD_VERSION }}", "versionCode": ${{ env.MOD_VERSIONCODE }}, - "zipUrl": "https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/p9_lte_combos_mod_v${{ env.MOD_VERSION }}.zip", - "changelog": "https://raw.githubusercontent.com/${{ github.repository }}/main/changelog-LTE.md" + "zipUrl": "https://git.hnrk.io/henrik/pixel9-EU-combos/releases/download/${{ env.RELEASE_TAG }}/p9_lte_combos_mod_v${{ env.MOD_VERSION }}.zip", + "changelog": "https://git.hnrk.io/henrik/pixel9-EU-combos/raw/branch/main/changelog-LTE.md" } EOF - name: Commit and push updater JSON run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" + git config --local user.email "action@gitea.com" + git config --local user.name "Gitea Action" git add updaterLTE.json git commit -m "Update updaterLTE.json for version ${{ env.MOD_VERSION }}" git push @@ -77,9 +92,9 @@ jobs: fi # Send to second chat (with error checking) - if ! curl -s -f -o /dev/null -F document=@"p9_lte_combos_mod_v${{ env.MOD_VERSION }}.zip" \ - -F caption="New LTE Module Release ${{ env.RELEASE_TAG }}" \ - "https://api.telegram.org/bot${BOT_TOKEN}/sendDocument?chat_id=${CHAT_ID_2}"; then - echo "Failed to send to second chat" - exit 1 - fi +# if ! curl -s -f -o /dev/null -F document=@"p9_lte_combos_mod_v${{ env.MOD_VERSION }}.zip" \ +# -F caption="New LTE Module Release ${{ env.RELEASE_TAG }}" \ +# "https://api.telegram.org/bot${BOT_TOKEN}/sendDocument?chat_id=${CHAT_ID_2}"; then +# echo "Failed to send to second chat" +# exit 1 +# fi