From dc3da0a73b0a9ecf79cb56d22e9f215d732d9f26 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Thu, 13 Jun 2024 19:00:59 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20fix=20release=20condition=20wher?= =?UTF-8?q?e=20`ref=5Fname`=20differs=20from=20`main`=20when=20pushing=20a?= =?UTF-8?q?=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ee3956..dbce401 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -72,7 +72,9 @@ jobs: name: wthrr-${{ matrix.target }} path: ${{ matrix.target }}/wthrr* - name: Prepare release - if: github.repository_owner == 'ttytm' && github.ref_name == 'main' && github.event_name == 'push' + if: > + github.repository_owner == 'ttytm' + && ((github.ref_name == 'main' && github.event_name == 'push') || github.ref_type == 'tag') run: | if [ "$GITHUB_REF_TYPE" == tag ]; then { @@ -95,7 +97,9 @@ jobs: with: tag_name: nightly - name: Release - if: github.repository_owner == 'ttytm' && github.ref_name == 'main' && github.event_name == 'push' + if: > + github.repository_owner == 'ttytm' + && ((github.ref_name == 'main' && github.event_name == 'push') || github.ref_type == 'tag') uses: softprops/action-gh-release@v2 with: files: ${{ matrix.target }}/wthrr* @@ -105,6 +109,6 @@ jobs: prerelease: ${{ env.IS_PRERELEASE }} - name: Publish on crates.io if: > - matrix.os == 'ubuntu-latest' && - github.repository_owner == 'ttytm' && github.ref_name == 'main' && github.ref_type == 'tag' + matrix.os == 'ubuntu-latest' && github.repository_owner == 'ttytm' + && ((github.ref_name == 'main' && github.event_name == 'push') || github.ref_type == 'tag') run: cargo publish --token ${{ secrets.CRATES_TOKEN }}