feat: add goreleaser config for cross-platform releases
Some checks failed
continuous-integration/drone/push Build encountered an error

Set up GoReleaser with Rust builder (cargo-zigbuild) targeting
linux/darwin x amd64/arm64, Gitea release publishing, and Homebrew
cask generation. Add mise tasks for test, release, and snapshot builds.
This commit is contained in:
2026-03-20 15:15:37 +01:00
parent f3cc24c9fc
commit be8faa6a36
5 changed files with 91 additions and 0 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
target/ target/
.cuddle/ .cuddle/
.DS_Store .DS_Store
dist/

62
.goreleaser.yaml Normal file
View File

@@ -0,0 +1,62 @@
version: 2
before:
hooks:
- cargo install --locked cargo-zigbuild
builds:
- id: gitnow
builder: rust
binary: gitnow
dir: .
targets:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
- aarch64-unknown-linux-gnu
- aarch64-apple-darwin
flags:
- --release
- -p=gitnow
- --features=vendored-openssl
archives:
- id: gitnow
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
checksum:
name_template: "checksums.txt"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^ci:"
gitea_urls:
api: https://git.kjuulh.io/api/v1
download: https://git.kjuulh.io
skip_tls_verify: false
release:
gitea:
owner: kjuulh
name: gitnow
draft: false
prerelease: auto
name_template: "v{{ .Version }}"
mode: keep-existing
homebrew_casks:
- name: gitnow
binaries:
- gitnow
repository:
owner: kjuulh
name: homebrew-tap
token: "{{ .Env.GITEA_TOKEN }}"
url:
template: "https://git.kjuulh.io/kjuulh/gitnow/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
homepage: "https://gitnow-client.prod.kjuulh.app"
description: "Git Now is a utility for easily navigating git projects from common upstream providers."

11
Cargo.lock generated
View File

@@ -779,6 +779,7 @@ dependencies = [
"minijinja", "minijinja",
"nucleo-matcher", "nucleo-matcher",
"octocrab", "octocrab",
"openssl",
"pretty_assertions", "pretty_assertions",
"prost", "prost",
"prost-types", "prost-types",
@@ -1592,6 +1593,15 @@ version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe"
[[package]]
name = "openssl-src"
version = "300.5.0+3.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f"
dependencies = [
"cc",
]
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.9.111" version = "0.9.111"
@@ -1600,6 +1610,7 @@ checksum = "82cab2d520aa75e3c58898289429321eb788c3106963d0dc886ec7a5f4adc321"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
"openssl-src",
"pkg-config", "pkg-config",
"vcpkg", "vcpkg",
] ]

View File

@@ -39,9 +39,11 @@ termwiz = "0.23.0"
regex = "1.11.1" regex = "1.11.1"
minijinja = "2" minijinja = "2"
shell-words = "1" shell-words = "1"
openssl = { version = "0.10", features = ["vendored"], optional = true }
[dev-dependencies] [dev-dependencies]
pretty_assertions = "1.4.0" pretty_assertions = "1.4.0"
[features] [features]
example = [] example = []
vendored-openssl = ["openssl/vendored"]

View File

@@ -1,6 +1,21 @@
[tools] [tools]
rust = "1.93" rust = "1.93"
cargo = "latest" cargo = "latest"
goreleaser = "latest"
zig = "latest"
"cargo:cargo-zigbuild" = "latest"
[tasks.install] [tasks.install]
run = "cargo install --path ./crates/gitnow" run = "cargo install --path ./crates/gitnow"
[tasks.test]
run = "cargo test --workspace"
description = "Run all workspace tests"
[tasks.release]
run = "goreleaser release --clean"
description = "Create a release using GoReleaser (requires GITEA_TOKEN and a git tag)"
[tasks.release-snapshot]
run = "goreleaser release --snapshot --clean"
description = "Build a local snapshot release without publishing"