Skip to content

Commit

Permalink
Use separate jobs for checks and release
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed May 5, 2024
1 parent 33ad5bf commit 08744f1
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ name: '🧑‍🏭'
on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest

check:
runs-on: ubuntu-22.04
steps:

- name: Checkout
uses: actions/checkout@v4
with:
Expand All @@ -22,16 +23,31 @@ jobs:
- name: Run linter and tests
run: go test -v -vet='all' ./...

release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') == true
needs: check
runs-on: ubuntu-22.04
steps:

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
check-latest: true
cache: true

- name: Build windows/amd64
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') == true
run: GOOS=windows GOARCH=amd64 go build -o ChunkCleaner-Win64.exe

- name: Build linux/amd64
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') == true
run: GOOS=linux GOARCH=amd64 go build -o ChunkCleaner-Linux64

- name: Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') == true
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
Expand Down

0 comments on commit 08744f1

Please sign in to comment.