Skip to content

Commit bc042c1

Browse files
committed
Initial commit with GoReleaser and GitHub Actions setup
0 parents  commit bc042c1

24 files changed

Lines changed: 3319 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on tags like v1.0.0, v0.1.0, etc.
7+
8+
permissions:
9+
contents: write # Needed to create releases
10+
# id-token: write # Uncomment if using OIDC for provenance
11+
12+
jobs:
13+
goreleaser:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # Required for changelog generation
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.21' # Specify your Go version, or use 'stable'
25+
26+
- name: Run GoReleaser
27+
uses: goreleaser/goreleaser-action@v5
28+
with:
29+
# The version of GoReleaser to use.
30+
# It is recommended to use the latest version.
31+
# See https://github.com/goreleaser/goreleaser-action/releases
32+
version: latest
33+
args: release --clean # Use --clean to ensure a clean build
34+
env:
35+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
# If you need to sign artifacts, you might need a GPG_FINGERPRINT
37+
# GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dist/
2+
.DS_Store
3+
.idea/
4+
.vscode/
5+
.env
6+
.env.local

.goreleaser.yaml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
version: 1
2+
3+
# .goreleaser.yaml
4+
# Visit https://goreleaser.com/intro/ for documentation
5+
6+
# Project metadata
7+
project_name: ithena-cli
8+
9+
# Environment variables for the build
10+
env:
11+
- CGO_ENABLED=0
12+
13+
# Build configuration
14+
builds:
15+
- id: ithena-cli
16+
main: ./main.go # Path to your main package
17+
binary: ithena-cli # Output binary name
18+
ldflags:
19+
- -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}}
20+
goos:
21+
- linux
22+
- darwin
23+
goarch:
24+
- amd64
25+
- arm64
26+
27+
# Archive configuration (create tar.gz files)
28+
archives:
29+
- id: default
30+
format: tar.gz
31+
# Name template for the archives
32+
name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
33+
files:
34+
- README.md # Include relevant files in the archive (path relative to project root?)
35+
36+
# Generate checksums
37+
checksum:
38+
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
39+
40+
# Snapshot configuration (for testing releases)
41+
snapshot:
42+
name_template: "{{ incpatch .Version }}-next"
43+
44+
# Changelog generation
45+
changelog:
46+
sort: asc
47+
filters:
48+
exclude:
49+
- "^docs:"
50+
- "^test:"
51+
- "^chore:"
52+
- "Merge pull request"
53+
- "Merge branch"
54+
55+
# ---- Release Configuration (Crucial for Public Release) ----
56+
# Publishes artifacts to the public ithena-one/ithena-cli-releases repository
57+
release:
58+
# Target repository for the release assets
59+
github:
60+
owner: ithena-one
61+
name: ithena-cli
62+
63+
# Set draft to true if you want to manually publish after goreleaser runs
64+
# draft: true
65+
66+
# ---- Homebrew Tap Configuration (Crucial for Public Tap) ----
67+
# Updates the formula in the public ithena-one/homebrew-ithena repository
68+
# brews:
69+
# - # Target repository for the release assets (where the formula lives)
70+
# repository:
71+
# owner: ithena-one
72+
# name: homebrew-ithena
73+
# # Specify the branch if not the default (e.g., main)
74+
# # branch: main
75+
# # Use standard GITHUB_TOKEN instead of custom variable
76+
# # token is now configured directly in the action
77+
#
78+
# # Commit author for the formula update
79+
# commit_author:
80+
# name: goreleaserbot
81+
# email: goreleaser@ithena.one
82+
#
83+
# # Simple commit message for formula update
84+
# commit_msg_template: "Brew formula update for {{ .ProjectName }} version {{ .Tag }}"
85+
86+
# # The Homebrew formula file name (defaults to project_name + .rb)
87+
# # formula: "ithena-cli.rb"
88+
89+
# # Description and homepage for the formula
90+
# description: "CLI tool for interacting with the Ithena platform"
91+
# homepage: "https://ithena.one"
92+
93+
# # Optional: Add dependencies
94+
# # dependencies:
95+
# # - name: git
96+
# # - name: node
97+
# # type: optional # or recommended
98+
99+
# # Optional: Specify installation command if binary name differs
100+
# # install: |
101+
# # bin.install "your-binary-name" => "ithena-cli"

0 commit comments

Comments
 (0)