From 9203706a2087720bf319da377f42ec0b28572c97 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Tue, 18 Feb 2025 22:18:49 +0100 Subject: [PATCH] feat: update version to 1.2.5; enhance Gitea release workflow and streamline release process --- .github/workflows/providers/gitea-release.yml | 33 ++++++++++--------- .github/workflows/release.yml | 16 ++++----- platformio.ini | 2 +- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.github/workflows/providers/gitea-release.yml b/.github/workflows/providers/gitea-release.yml index a68fbda..7ede575 100644 --- a/.github/workflows/providers/gitea-release.yml +++ b/.github/workflows/providers/gitea-release.yml @@ -66,37 +66,38 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - name: Create Release - env: + env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_API_URL: ${{ secrets.GITEA_API_URL }} - run: | + GITEA_REPOSITORY: ${{ secrets.GITEA_REPOSITORY }} + run: | # Create release using Gitea API RESPONSE=$(curl -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/json" \ - -H "accept: application/json" \ - ${GITEA_API_URL}/repos/${GITHUB_REPOSITORY}/releases \ - -d '{ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -H "accept: application/json" \ + "${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases" \ + -d '{ "tag_name": "${{ github.ref_name }}", "name": "Release ${{ steps.get_version.outputs.VERSION }}", "body": "${{ steps.changelog.outputs.CHANGES }}", "draft": false, "prerelease": false - }') + }') # Extract release ID from response RELEASE_ID=$(echo $RESPONSE | jq -r .id) # Upload full firmware curl -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/octet-stream" \ - ${GITEA_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_full.bin \ - --data-binary @.pio/build/esp32dev/filaman_full.bin + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/octet-stream" \ + "${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_full.bin" \ + --data-binary @.pio/build/esp32dev/filaman_full.bin # Upload OTA firmware curl -X POST \ - -H "Authorization: token ${GITEA_TOKEN}" \ - -H "Content-Type: application/octet-stream" \ - ${GITEA_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_ota.bin \ - --data-binary @.pio/build/esp32dev/filaman_ota.bin \ No newline at end of file + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/octet-stream" \ + "${GITEA_API_URL}/repos/${GITEA_REPOSITORY}/releases/${RELEASE_ID}/assets?name=filaman_ota.bin" \ + --data-binary @.pio/build/esp32dev/filaman_ota.bin \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f61c07b..352a8cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,16 +17,14 @@ jobs: run: | if [[ "$GITHUB_SERVER_URL" == "https://github.com" ]]; then echo "platform=github" >> $GITHUB_OUTPUT - elif [[ "$CI_SERVER_URL" == *"gitlab"* ]]; then - echo "platform=gitlab" >> $GITHUB_OUTPUT else echo "platform=gitea" >> $GITHUB_OUTPUT fi - - name: Run GitHub Release - if: steps.platform.outputs.platform == 'github' - uses: ./.github/workflows/providers/github-release.yml - - - name: Run Gitea Release - if: steps.platform.outputs.platform == 'gitea' - uses: ./.github/workflows/providers/gitea-release.yml \ No newline at end of file + - name: Run Release Workflow + run: | + if [[ "${{ steps.platform.outputs.platform }}" == "github" ]]; then + ./.github/workflows/providers/github-release.sh + else + ./.github/workflows/providers/gitea-release.sh + fi \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 05024e2..082da92 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [common] -version = "1.2.4" +version = "1.2.5" [env:esp32dev] platform = espressif32