Skip to content

Commit

Permalink
Fix github release event #853
Browse files Browse the repository at this point in the history
  • Loading branch information
cxong committed Dec 7, 2024
1 parent 38ae30a commit 6732edd
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [ master ]
release:
types: [published, created, edited]
types: [published]

env:
VERSION: 2.2.0
Expand Down Expand Up @@ -136,16 +136,21 @@ jobs:
uses: softprops/action-gh-release@v1
if: >
startsWith(github.ref, 'refs/tags/') &&
(!startsWith(matrix.os, 'ubuntu') || (matrix.cc == 'gcc' && matrix.cc_version == 'latest')) &&
github.event.release.created
(!startsWith(matrix.os, 'ubuntu') || (matrix.cc == 'gcc' && matrix.cc_version == 'latest')) &&
github.event.release.published
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: C-Dogs*SDL-*-*.*
fail_on_unmatched_files: true

- name: Publish to itch.io (Linux)
if: startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' && matrix.cc_version == 'latest' && github.event.release.created
if: >
startsWith(github.ref, 'refs/tags/') &&
startsWith(matrix.os, 'ubuntu') &&
matrix.cc == 'gcc' &&
matrix.cc_version == 'latest' &&
github.event.release.published
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
Expand All @@ -156,7 +161,10 @@ jobs:
./butler push C-Dogs*SDL-*-Linux.tar.gz congusbongus/cdogs-sdl:linux --userversion $VERSION
- name: Publish to itch.io (macOS)
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'macos-latest' && github.event.release.created
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'macos-latest' &&
github.event.release.published
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
Expand All @@ -167,7 +175,10 @@ jobs:
./butler push C-Dogs*SDL-*-OSX.dmg congusbongus/cdogs-sdl:mac --userversion $VERSION
- name: Publish to itch.io (Windows)
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'windows-latest' && github.event.release.created
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'windows-latest' &&
github.event.release.published
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
Expand Down
23 changes: 17 additions & 6 deletions .github/workflows/cmake.yml.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [ master ]
release:
types: [published, created, edited]
types: [published]

env:
VERSION: @VERSION@
Expand Down Expand Up @@ -136,16 +136,21 @@ jobs:
uses: softprops/action-gh-release@v1
if: >
startsWith(github.ref, 'refs/tags/') &&
(!startsWith(matrix.os, 'ubuntu') || (matrix.cc == 'gcc' && matrix.cc_version == 'latest')) &&
github.event.release.created
(!startsWith(matrix.os, 'ubuntu') || (matrix.cc == 'gcc' && matrix.cc_version == 'latest')) &&
github.event.release.published
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: C-Dogs*SDL-*-*.*
fail_on_unmatched_files: true

- name: Publish to itch.io (Linux)
if: startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'ubuntu') && matrix.cc == 'gcc' && matrix.cc_version == 'latest' && github.event.release.created
if: >
startsWith(github.ref, 'refs/tags/') &&
startsWith(matrix.os, 'ubuntu') &&
matrix.cc == 'gcc' &&
matrix.cc_version == 'latest' &&
github.event.release.published
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
Expand All @@ -156,7 +161,10 @@ jobs:
./butler push C-Dogs*SDL-*-Linux.tar.gz congusbongus/cdogs-sdl:linux --userversion $VERSION

- name: Publish to itch.io (macOS)
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'macos-latest' && github.event.release.created
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'macos-latest' &&
github.event.release.published
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
Expand All @@ -167,7 +175,10 @@ jobs:
./butler push C-Dogs*SDL-*-OSX.dmg congusbongus/cdogs-sdl:mac --userversion $VERSION

- name: Publish to itch.io (Windows)
if: startsWith(github.ref, 'refs/tags/') && matrix.os == 'windows-latest' && github.event.release.created
if: >
startsWith(github.ref, 'refs/tags/') &&
matrix.os == 'windows-latest' &&
github.event.release.published
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: |
Expand Down

0 comments on commit 6732edd

Please sign in to comment.