Skip to content

Commit

Permalink
feat: split development and release build github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
wintermi committed Aug 27, 2023
1 parent 4bdbab7 commit 9d1d6d2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
29 changes: 1 addition & 28 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
name: Go - Release Build
name: Go - Development Build

on:
pull_request:
push:
branches:
- main
tags:
- '*'

concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true

permissions:
contents: write


jobs:
build:

Expand Down Expand Up @@ -62,24 +56,3 @@ jobs:
skip-pkg-cache: true
skip-build-cache: true
args: --timeout=10m

goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v4.0.1
with:
go-version: 1.20.7
- name: Execute GoReleaser
uses: goreleaser/goreleaser-action@v4.4.0
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Go - Release Build

on:
push:
tags:
- '*'

concurrency:
# Cancels pending runs when a PR gets updated.
group: ${{ github.head_ref || github.run_id }}-${{ github.actor }}
cancel-in-progress: true

permissions:
contents: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.5.3
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Setup Go
uses: actions/setup-go@v4.0.1
with:
go-version: 1.20.7
- name: Execute GoReleaser
uses: goreleaser/goreleaser-action@v4.4.0
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 9d1d6d2

Please sign in to comment.