ci: add GoReleaser + CI workflow for cross-platform releases (#5)

This commit is contained in:
Adem Baccara
2025-08-30 21:56:05 +01:00
committed by GitHub
parent 75b0170461
commit 74620c8f59
3 changed files with 88 additions and 1 deletions
+22
View File
@@ -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 }}
+3 -1
View File
@@ -33,4 +33,6 @@ go.work.sum
brainstorm
.idea
bin
.DS_Store
.DS_Store
# Added by goreleaser init:
dist/
+63
View File
@@ -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).