Skip to content

Commit

Permalink
Run build and release only on release AND with tags
Browse files Browse the repository at this point in the history
  • Loading branch information
nhh committed Sep 22, 2024
1 parent f195d1d commit 0ccaa0e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ name: Build and release binaries
on:
push:
branches: [ "release" ]
tags:
- v*

jobs:
build-linux:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -27,6 +26,7 @@ jobs:
name: k8x-linux-x86_64
path: ./k8x-linux-x86_64
build-macos:
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -43,6 +43,7 @@ jobs:
name: k8x-darwin-x86_64
path: ./k8x-darwin-x86_64
build-windows:
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -59,6 +60,7 @@ jobs:
name: k8x-windows-x86_64.exe
path: ./k8x-windows-x86_64.exe
release:
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
needs:
Expand All @@ -72,6 +74,5 @@ jobs:
uses: actions/download-artifact@v4
- name: Create github release
uses: ncipollo/release-action@v1
if: startsWith(github.ref, 'refs/tags/')
with:
artifacts: "./*/k8x-*"

0 comments on commit 0ccaa0e

Please sign in to comment.