Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: reuse the release workflow #43

Merged
merged 2 commits into from
May 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,3 @@ updates:
directory: /
schedule:
interval: daily
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
32 changes: 11 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@ name: release

on:
push:
tags: [ v* ]
tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
workflow_dispatch:
inputs:
version:
type: string
required: true
description: The next semantic version to release

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version-file: go.mod

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
uses: go-simpler/.github/.github/workflows/release.yml@main
with:
version: ${{ github.event_name == 'push' && github.ref_name || inputs.version }}
use-goreleaser: true
4 changes: 2 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ builds:
flags:
- -trimpath
ldflags:
- -s -w -X main.version={{.Version}}
- -s -w -X main.version={{ .Version }}
targets:
- darwin_amd64
- darwin_arm64
Expand All @@ -23,7 +23,7 @@ brews:
- tap:
owner: tmzane
name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
token: '{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}'
homepage: https://github.com/tmzane/musttag
description: A Go linter that enforces field tags in (un)marshaled structs
license: MPL-2.0