Skip to content

Commit

Permalink
🤖 fix release condition where ref_name differs from main when pus…
Browse files Browse the repository at this point in the history
…hing a tag
  • Loading branch information
ttytm committed Jun 13, 2024
1 parent a828e50 commit dc3da0a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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*
Expand All @@ -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 }}

0 comments on commit dc3da0a

Please sign in to comment.