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: use tagpr #200

Merged
merged 1 commit into from
Aug 16, 2024
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
21 changes: 21 additions & 0 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: release
inputs:
github-token:
required: true
homebrew-tap-github-token:
required: true
runs:
using: composite
steps:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ inputs.homebrew-tap-github-token }}
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.21
go-version-file: go.mod
id: go
- name: Cache
uses: actions/cache@v4
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# for manual release (No triggering when tagpr is used.)
name: release
on:
push:
Expand All @@ -11,15 +12,7 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
- uses: ./.github/actions/release
with:
go-version: 1.21
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
homebrew-tap-github-token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/tagpr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: tagpr
on:
push:
branches:
- "main"
jobs:
tagpr:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: tagpr
id: tagpr
uses: Songmu/tagpr@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/release
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
homebrew-tap-github-token: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
if: "steps.tagpr.outputs.tag != ''"
Loading