diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..79033ad --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: release +on: + push: + tags: + - 'v*' +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.22.x + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + version: 2.9.0 + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.gitignore b/.gitignore index 711857f..70f9531 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,6 @@ go.work.sum brainstorm .idea bin -.DS_Store \ No newline at end of file +.DS_Store +# Added by goreleaser init: +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..48513c0 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,63 @@ +version: 2 +project_name: lazyssh + +before: + hooks: + - go mod tidy + +builds: + - goos: + - linux + - windows + - darwin + goarch: + - amd64 + - arm + - arm64 + - 386 + main: ./cmd/main.go + ldflags: + -X main.version={{.Version}} -X main.gitCommit={{.Commit}} -X main.buildTime={{.Date}} + + + +archives: + - formats: [ tar.gz ] + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + formats: [ zip ] + +checksum: + name_template: "checksums.txt" + +snapshot: + name_template: "{{ .Tag }}-next" + +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:" +brews: + - repository: + owner: adembc + name: homebrew-tap + homepage: "https://github.com/adembc/lazyssh" + description: "A simple terminal UI for managing SSH connections. " + +release: + footer: >- + + --- + + Released by [GoReleaser](https://github.com/goreleaser/goreleaser).