Skip to content

Commit

Permalink
ci: reuse the release workflow (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmzane authored May 6, 2023
1 parent 25a6110 commit 0dedcdf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 27 deletions.
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

0 comments on commit 0dedcdf

Please sign in to comment.