diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..39d96d5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,42 @@ +name: Build binaries + +on: + push: + branches: [main] + +jobs: + build: + if: github.repository == 'Allra-Fintech/git-issue' + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.23" + cache: true + + - name: Install dependencies + run: go mod download + + - name: Run tests + run: make test + + - name: Run linter + run: make lint + + - name: Build cross-platform binaries + run: make build-all + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: gi-binaries-${{ github.sha }} + path: | + gi-darwin-arm64 + gi-darwin-amd64 + gi-linux-amd64 + retention-days: 7 diff --git a/.gitignore b/.gitignore index cdd10d2..e6a48fb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ # https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore # # Binaries for programs and plugins -gi +/gi git-issue-* *.exe *.exe~ diff --git a/.issues/open/009-build-in-cicd.md b/.issues/closed/009-build-in-cicd.md similarity index 97% rename from .issues/open/009-build-in-cicd.md rename to .issues/closed/009-build-in-cicd.md index ad7b44e..6351920 100644 --- a/.issues/open/009-build-in-cicd.md +++ b/.issues/closed/009-build-in-cicd.md @@ -3,7 +3,7 @@ id: "009" assignee: "" labels: [] created: 2025-11-14T17:23:12.796868+09:00 -updated: 2025-11-14T17:23:12.796868+09:00 +updated: 2025-11-14T22:36:02.833639+09:00 --- # Build in CI/CD diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 16425fd..cd6eb8a 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -33,6 +33,11 @@ make clean # Install locally (default ~/.local/bin; override INSTALL_DIR if needed) make install + +# Download latest CI-built binaries (requires repo access): +# 1. git pull origin main +# 2. Go to GitHub → Actions → "Build binaries" workflow +# 3. Download gi-binaries- artifact for your platform ``` ### Makefile Targets diff --git a/cmd/gi/main.go b/cmd/gi/main.go new file mode 100644 index 0000000..81ab2c5 --- /dev/null +++ b/cmd/gi/main.go @@ -0,0 +1,19 @@ +package main + +import ( + "fmt" + "os" + + "github.com/Allra-Fintech/git-issue/cmd" +) + +var version = "dev" + +func main() { + cmd.SetVersion(version) + + if err := cmd.Execute(); err != nil { + fmt.Fprintf(os.Stderr, "Error: %v\n", err) + os.Exit(1) + } +}