From e5ab2f3028569579b2354d913f4583089394642d Mon Sep 17 00:00:00 2001 From: Grigory Rylov Date: Wed, 11 Nov 2026 15:15:29 +0300 Subject: [PATCH] Attach plugin zip to release even when tag already exists app-build.yml publishes the release first on master merges; the plugin workflow then skipped publishing because its tag-exists check assumed the tag meant 'already released'. Multiple merges share one date-based yampVersion, so plugins never reached releases. Upload unconditionally: softprops/action-gh-release appends the asset to an existing release. --- .github/workflows/build-plugin.yml | 40 +++++------------------------- 1 file changed, 6 insertions(+), 34 deletions(-) diff --git a/.github/workflows/build-plugin.yml b/.github/workflows/build-plugin.yml index 4a93f26..f287f2b 100644 --- a/.github/workflows/build-plugin.yml +++ b/.github/workflows/build-plugin.yml @@ -41,33 +41,12 @@ jobs: run: | mv plugin/build/distributions/*.zip plugin/build/distributions/yamp_plugin_${{ steps.get_version.outputs.version }}.zip - - name: Check release tag - id: tag_check - run: | - if git ls-remote --tags origin "refs/tags/v${{ steps.get_version.outputs.version }}" | grep -q .; then - echo "exists=true" >> "$GITHUB_OUTPUT" - else - echo "exists=false" >> "$GITHUB_OUTPUT" - fi - - - name: Create tag - if: steps.tag_check.outputs.exists == 'false' - run: | - git config --global user.name 'github-actions' - git config --global user.email 'github-actions@github.com' - git tag v${{ steps.get_version.outputs.version }} - git push origin v${{ steps.get_version.outputs.version }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Skip release when tag already exists - if: steps.tag_check.outputs.exists == 'true' - run: | - echo "::warning::Tag v${{ steps.get_version.outputs.version }} already exists; skipping plugin release. Bump yampVersion in gradle.properties to publish a new version." - - - name: Create GitHub Release - id: create_release - if: steps.tag_check.outputs.exists == 'false' + # Attaches the plugin zip to the release for this version. + # softprops/action-gh-release creates the release+tag when missing and + # appends the asset to the existing release when the tag was already + # published (e.g. by app-build.yml). Never skip: multiple merges share a + # date-based version, and the plugin must land on the release regardless. + - name: Upload plugin artifact to GitHub Release uses: softprops/action-gh-release@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -77,11 +56,4 @@ jobs: draft: false prerelease: false generate_release_notes: true - - - name: Upload plugin artifact to release - if: steps.tag_check.outputs.exists == 'false' - uses: softprops/action-gh-release@v2 - with: files: plugin/build/distributions/yamp_plugin_${{ steps.get_version.outputs.version }}.zip - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}