From b550c7e8affeac4aac5c2d9bb12f510fc5a61caf Mon Sep 17 00:00:00 2001 From: Thiago Date: Tue, 2 Apr 2024 20:01:41 -0300 Subject: [PATCH] Update release workflow and go-gemini-cli binary name --- .github/workflows/release.yml | 42 +++++++++++++++++------------------ .gitignore | 2 +- .goreleaser.yaml | 19 ++++++++++++++++ go.mod | 2 +- main.go | 3 +-- 5 files changed, 43 insertions(+), 25 deletions(-) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 895f31e..2748d9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,30 +1,30 @@ -# This workflow will build a golang project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go - name: Release on: push: tags: - - 'v*' + - "v*" + +permissions: + contents: write jobs: - release: + goreleaser: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v4 - with: - go-version: '1.22' - - - name: Build - run: go build -o go-gemini-cli - - - name: Upload CLI - uses: actions/upload-artifact@v4 - with: - name: go-gemini-cli - path: go-gemini-cli + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: ${{ env.GITHUB_REF_NAME}} + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9e625b6..f634659 100644 --- a/.gitignore +++ b/.gitignore @@ -29,4 +29,4 @@ bin .idea/ .vscode/ *.iml -go-gemini +go-gemini-cli diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..55ff741 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,19 @@ +builds: + - binary: go-gemini-cli + goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm64 + env: + - CGO_ENABLED=0 + flags: + - -mod=vendor + +release: + prerelease: auto + +universal_binaries: + - replace: true \ No newline at end of file diff --git a/go.mod b/go.mod index 869a7ce..83c4c26 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module go-gemini +module github.com/thiagosousasantana/go-gemini-cli go 1.22.0 diff --git a/main.go b/main.go index b996d3b..928e61e 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,9 @@ /* Copyright © 2024 Thiago Santana - */ package main -import "go-gemini/cmd" +import "github.com/thiagosousasantana/go-gemini-cli/cmd" func main() { cmd.Execute()