Skip to content

Commit 967dc6c

Browse files
authored
Merge pull request #3 from satococoa/codex/homebrew-main-rebased
Add Homebrew release automation and MIT license
2 parents db3d596 + 0555dcd commit 967dc6c

5 files changed

Lines changed: 172 additions & 0 deletions

File tree

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Bump Homebrew Formula
2+
3+
on:
4+
release:
5+
types:
6+
- released
7+
workflow_dispatch:
8+
inputs:
9+
tag_name:
10+
description: "Tag name to bump (for example: v0.1.0)"
11+
required: true
12+
type: string
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
bump-homebrew-formula:
19+
if: ${{ (github.event_name == 'release' && github.event.release.prerelease == false) || github.event_name == 'workflow_dispatch' }}
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Resolve tag
23+
id: tag
24+
run: |
25+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
26+
echo "name=${{ inputs.tag_name }}" >> "$GITHUB_OUTPUT"
27+
else
28+
echo "name=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
29+
fi
30+
31+
- name: Skip prerelease tags
32+
if: ${{ contains(steps.tag.outputs.name, '-') }}
33+
run: |
34+
echo "Skipping prerelease tag: ${{ steps.tag.outputs.name }}"
35+
36+
- name: Bump Homebrew formula
37+
if: ${{ !contains(steps.tag.outputs.name, '-') }}
38+
uses: mislav/bump-homebrew-formula-action@v3
39+
with:
40+
homebrew-tap: satococoa/homebrew-tap
41+
formula-name: git-worktreeinclude
42+
formula-path: git-worktreeinclude.rb
43+
tag-name: ${{ steps.tag.outputs.name }}
44+
env:
45+
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}

‎.github/workflows/release.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version-file: go.mod
24+
cache: true
25+
26+
- name: Run tests
27+
run: go test ./...
28+
29+
- name: Run GoReleaser
30+
uses: goreleaser/goreleaser-action@v7
31+
with:
32+
distribution: goreleaser
33+
version: "~> v2"
34+
args: release --clean
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}

‎.goreleaser.yml‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
2+
version: 2
3+
4+
project_name: git-worktreeinclude
5+
6+
builds:
7+
- id: git-worktreeinclude
8+
binary: git-worktreeinclude
9+
main: ./cmd/git-worktreeinclude
10+
env:
11+
- CGO_ENABLED=0
12+
goos:
13+
- darwin
14+
- linux
15+
goarch:
16+
- amd64
17+
- arm64
18+
flags:
19+
- -trimpath
20+
ldflags:
21+
- -s -w
22+
23+
archives:
24+
- id: default
25+
formats:
26+
- tar.gz
27+
name_template: >-
28+
{{- .ProjectName }}_
29+
{{- .Version }}_
30+
{{- title .Os }}_
31+
{{- if eq .Arch "amd64" }}x86_64
32+
{{- else }}{{ .Arch }}{{ end }}
33+
{{- if .Arm }}v{{ .Arm }}{{ end }}
34+
files:
35+
- README.md
36+
- LICENSE
37+
38+
checksum:
39+
name_template: checksums.txt
40+
41+
snapshot:
42+
version_template: "{{ incpatch .Version }}-next"
43+
44+
changelog:
45+
sort: asc
46+
filters:
47+
exclude:
48+
- "^docs:"
49+
- "^test:"
50+
- "^chore:"
51+
- "^ci:"
52+
53+
release:
54+
github:
55+
owner: satococoa
56+
name: git-worktreeinclude
57+
draft: false
58+
prerelease: auto
59+
name_template: "{{ .ProjectName }} {{ .Version }}"

‎LICENSE‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Satoshi Ebisawa
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@
44

55
## Quickstart
66

7+
### Install (Homebrew)
8+
9+
```sh
10+
brew tap satococoa/tap
11+
brew install satococoa/tap/git-worktreeinclude
12+
```
13+
714
### Build
815

916
```sh
@@ -214,3 +221,7 @@ make ci
214221

215222
CI runs on pull requests and pushes to `main` via GitHub Actions.
216223
`golangci-lint` is used with its default configuration (no `.golangci.yml`).
224+
225+
## License
226+
227+
MIT. See [LICENSE](LICENSE).

0 commit comments

Comments
 (0)