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 28, 2023
1 parent fe5a2bf commit 8704797
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
name: Go
name: Go - Development Build

on: [push]
on:
pull_request:
push:
branches:
- main

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

jobs:
build:
Expand Down Expand Up @@ -40,7 +49,6 @@ jobs:
uses: actions/[email protected]
with:
go-version: 1.20.7

- name: Run golangci-lint
uses: golangci/[email protected]
with:
Expand Down
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/[email protected]
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Setup Go
uses: actions/[email protected]
with:
go-version: 1.20.7
- name: Execute GoReleaser
uses: goreleaser/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BigQuery Query Runner

[![Workflows](https://github.com/wintermi/bqrunner/workflows/Go/badge.svg)](https://github.com/wintermi/bqrunner/actions/workflows/go.yml)
[![Workflows](https://github.com/wintermi/bqrunner/workflows/Go/badge.svg)](https://github.com/wintermi/bqrunner/actions)
[![Go Report](https://goreportcard.com/badge/github.com/wintermi/bqrunner)](https://goreportcard.com/report/github.com/wintermi/bqrunner)
[![License](https://img.shields.io/github/license/wintermi/bqrunner.svg)](https://github.com/wintermi/bqrunner/blob/main/LICENSE)
[![Release](https://img.shields.io/github/v/release/wintermi/bqrunner?include_prereleases)](https://github.com/wintermi/bqrunner/releases)
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

var logger zerolog.Logger
var applicationText = "%s 0.1.1%s"
var applicationText = "%s 0.1.2%s"
var copyrightText = "Copyright 2022-2023, Matthew Winter\n"
var indent = "..."

Expand Down

0 comments on commit 8704797

Please sign in to comment.