From 45130a609f70946b5d0fe45ed704cf640f8298e1 Mon Sep 17 00:00:00 2001 From: Tom <73077675+tmzane@users.noreply.github.com> Date: Sat, 6 May 2023 03:44:52 +0300 Subject: [PATCH 1/2] ci: reuse the `release` workflow --- .github/dependabot.yml | 4 ---- .github/workflows/release.yml | 32 +++++++++++--------------------- .goreleaser.yml | 4 ++-- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2fccaad..36b24f2 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -4,7 +4,3 @@ updates: directory: / schedule: interval: daily - - package-ecosystem: github-actions - directory: / - schedule: - interval: daily diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e69a038..b7a72c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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@use-goreleaser-input + with: + version: ${{ github.event_name == 'push' && github.ref_name || inputs.version }} + use-goreleaser: true diff --git a/.goreleaser.yml b/.goreleaser.yml index e0d3d4d..8748067 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -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 @@ -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 From 10fc57c18516bb211d5ffbf8faf30724d30c39f1 Mon Sep 17 00:00:00 2001 From: Tom <73077675+tmzane@users.noreply.github.com> Date: Sat, 6 May 2023 16:16:15 +0300 Subject: [PATCH 2/2] switch to `main` --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b7a72c8..db81679 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,7 @@ on: jobs: release: - uses: go-simpler/.github/.github/workflows/release.yml@use-goreleaser-input + uses: go-simpler/.github/.github/workflows/release.yml@main with: version: ${{ github.event_name == 'push' && github.ref_name || inputs.version }} use-goreleaser: true