From e0b8da079e2dd851642606e9feec48a64efa58a0 Mon Sep 17 00:00:00 2001 From: Manuel Weiser Date: Wed, 19 Feb 2025 00:26:40 +0100 Subject: [PATCH] feat: update version to 1.2.12 and refactor release workflows for improved provider detection and execution --- .github/workflows/providers/gitea-release.yml | 6 ++- .github/workflows/release.yml | 45 +++++++------------ platformio.ini | 2 +- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/.github/workflows/providers/gitea-release.yml b/.github/workflows/providers/gitea-release.yml index 95ff349..71c5914 100644 --- a/.github/workflows/providers/gitea-release.yml +++ b/.github/workflows/providers/gitea-release.yml @@ -111,4 +111,8 @@ EOF exit 1 fi echo "Successfully uploaded $file" - done \ No newline at end of file + done + } + } + } +} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2fc20a3..055ab43 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,19 +11,9 @@ jobs: outputs: version: ${{ steps.get_version.outputs.VERSION }} changelog: ${{ steps.changelog.outputs.CHANGES }} - provider: ${{ steps.detect-provider.outputs.provider }} steps: - uses: actions/checkout@v4 - - name: Detect provider - id: detect-provider - run: | - if [[ "$GITHUB_SERVER_URL" == "https://github.com" ]]; then - echo "provider=github" >> $GITHUB_OUTPUT - else - echo "provider=gitea" >> $GITHUB_OUTPUT - fi - - name: Get version from tag id: get_version run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT @@ -33,9 +23,6 @@ jobs: PIO_VERSION=$(grep '^version = ' platformio.ini | cut -d'"' -f2) TAG_VERSION=${{ steps.get_version.outputs.VERSION }} - echo "PlatformIO version: $PIO_VERSION" - echo "Tag version: $TAG_VERSION" - if [ "$PIO_VERSION" != "$TAG_VERSION" ]; then echo "Error: Version mismatch between tag ($TAG_VERSION) and platformio.ini ($PIO_VERSION)" exit 1 @@ -49,20 +36,22 @@ jobs: echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT - github-release: - needs: prepare - if: needs.prepare.outputs.provider == 'github' - uses: ./.github/workflows/providers/github-release.yml - with: - version: ${{ needs.prepare.outputs.version }} - changelog: ${{ needs.prepare.outputs.changelog }} - secrets: inherit + - name: Determine provider + id: detect-provider + run: | + if [[ "$GITHUB_SERVER_URL" == "https://github.com" ]]; then + echo "provider=github" >> $GITHUB_OUTPUT + else + echo "provider=gitea" >> $GITHUB_OUTPUT + fi - gitea-release: + release: needs: prepare - if: needs.prepare.outputs.provider == 'gitea' - uses: ./.github/workflows/providers/gitea-release.yml - with: - version: ${{ needs.prepare.outputs.version }} - changelog: ${{ needs.prepare.outputs.changelog }} - secrets: inherit \ No newline at end of file + runs-on: ubuntu-latest + steps: + - name: Run provider workflow + uses: ./.github/workflows/providers/${{ needs.prepare.outputs.provider == 'github' && 'github' || 'gitea' }}-release.yml + with: + version: ${{ needs.prepare.outputs.version }} + changelog: ${{ needs.prepare.outputs.changelog }} + secrets: inherit \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 3344a5f..a186b50 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ ; https://docs.platformio.org/page/projectconf.html [common] -version = "1.2.11" +version = "1.2.12" [env:esp32dev] platform = espressif32