Skip to content

Commit

Permalink
chore: extract build job from release
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed May 13, 2024
1 parent 652634b commit c3a9e93
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ on:
workflow_dispatch:

jobs:
release:
build:
runs-on: ubuntu-latest
if: (!startsWith(github.ref, 'refs/tags/'))
strategy:
matrix:
version: ['1.18']
Expand All @@ -38,7 +39,7 @@ jobs:
go-version: ${{ matrix.version }}
check-latest: true
cache: true
- name: Build and package with GoReleaser for testing
- name: Build and package with GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
Expand All @@ -50,15 +51,31 @@ jobs:
with:
name: dist
path: dist/
- name: Build and package with GoReleaser for deploy
if: startsWith(github.ref, 'refs/tags/')

release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
strategy:
matrix:
version: ['1.18']
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Golang
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.version }}
check-latest: true
cache: true
- name: Build and package with GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: --skip-publish
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
Expand Down

0 comments on commit c3a9e93

Please sign in to comment.