diff --git a/.goreleaser.yml b/.goreleaser.yml index eaeacb4..6dc5483 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -43,6 +43,26 @@ nfpms: - rpm - apk +brews: + - repository: + owner: nasimstg + name: homebrew-tap + homepage: "https://github.com/nasimstg/xenvsync" + description: "Encrypt, commit, and inject .env secrets — no cloud required" + license: "MIT" + install: | + bin.install "xenvsync" + test: | + system "#{bin}/xenvsync", "version" + +scoops: + - repository: + owner: nasimstg + name: scoop-bucket + homepage: "https://github.com/nasimstg/xenvsync" + description: "Encrypt, commit, and inject .env secrets — no cloud required" + license: "MIT" + changelog: sort: asc filters: diff --git a/README.md b/README.md index 45c399a..9558e67 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,13 @@ ## Install ```bash +# Homebrew (macOS / Linux) +brew install nasimstg/tap/xenvsync + +# Scoop (Windows) +scoop bucket add nasimstg https://github.com/nasimstg/scoop-bucket +scoop install xenvsync + # npm npm install -g @nasimstg/xenvsync @@ -42,6 +49,9 @@ npx @nasimstg/xenvsync # Go 1.22+ go install github.com/nasimstg/xenvsync@latest + +# Nix +nix run github:nasimstg/xenvsync ``` Or download a prebuilt binary from [Releases](https://github.com/nasimstg/xenvsync/releases). @@ -56,6 +66,16 @@ make build ``` +
+Arch Linux (AUR) + +```bash +git clone https://aur.archlinux.org/xenvsync.git +cd xenvsync +makepkg -si +``` +
+ ## Quick Start ```bash @@ -220,6 +240,9 @@ xenvsync/ │ ├── docker/ # Dockerfile, compose, entrypoint │ ├── ci/ # GitHub Actions, GitLab, CircleCI, Bitbucket │ └── hooks/ # Git pre-commit hook +├── packaging/ +│ └── aur/ # Arch Linux AUR PKGBUILD +├── flake.nix # Nix flake for NixOS / nix users ├── Makefile # build, test, lint, install ├── .goreleaser.yml # cross-platform release builds └── .github/workflows/ci.yml # CI: test matrix, lint, release diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..7dc7ac5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,40 @@ +{ + description = "xenvsync - Encrypt, commit, and inject .env secrets"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + packages.default = pkgs.buildGoModule { + pname = "xenvsync"; + version = "1.9.0"; + src = ./.; + vendorHash = null; + + ldflags = [ + "-s" "-w" + "-X main.version=${self.packages.${system}.default.version}" + ]; + + meta = with pkgs.lib; { + description = "Encrypt, commit, and inject .env secrets — no cloud required"; + homepage = "https://github.com/nasimstg/xenvsync"; + license = licenses.mit; + maintainers = []; + mainProgram = "xenvsync"; + }; + }; + + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ go gopls golangci-lint ]; + }; + } + ); +} diff --git a/packaging/aur/PKGBUILD b/packaging/aur/PKGBUILD new file mode 100644 index 0000000..4b7763b --- /dev/null +++ b/packaging/aur/PKGBUILD @@ -0,0 +1,23 @@ +# Maintainer: Md Nasim Sheikh +pkgname=xenvsync +pkgver=1.9.0 +pkgrel=1 +pkgdesc="Encrypt, commit, and inject .env secrets — no cloud required" +arch=('x86_64' 'aarch64') +url="https://github.com/nasimstg/xenvsync" +license=('MIT') +makedepends=('go') +source=("${pkgname}-${pkgver}.tar.gz::https://github.com/nasimstg/xenvsync/archive/v${pkgver}.tar.gz") +sha256sums=('SKIP') + +build() { + cd "${pkgname}-${pkgver}" + export CGO_ENABLED=0 + go build -ldflags "-s -w -X main.version=${pkgver}" -o "${pkgname}" . +} + +package() { + cd "${pkgname}-${pkgver}" + install -Dm755 "${pkgname}" "${pkgdir}/usr/bin/${pkgname}" + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} diff --git a/website/src/app/docs/installation/page.tsx b/website/src/app/docs/installation/page.tsx index 3e45279..4f96f8e 100644 --- a/website/src/app/docs/installation/page.tsx +++ b/website/src/app/docs/installation/page.tsx @@ -20,6 +20,19 @@ export default function Installation() { description="Multiple ways to install xenvsync on any platform." /> +
+ + {`$ brew install nasimstg/tap/xenvsync`} + +
+ +
+ +{`$ scoop bucket add nasimstg https://github.com/nasimstg/scoop-bucket +$ scoop install xenvsync`} + +
+
{`$ npm install -g @nasimstg/xenvsync`} @@ -87,6 +100,24 @@ $ make build`}

+
+ +{`# Run without installing +$ nix run github:nasimstg/xenvsync + +# Add to your flake inputs +$ nix profile install github:nasimstg/xenvsync`} + +
+ +
+ +{`$ git clone https://aur.archlinux.org/xenvsync.git +$ cd xenvsync +$ makepkg -si`} + +
+
{`$ xenvsync version @@ -120,8 +151,9 @@ xenvsync v0.1.0 Replace the binary with a newer version. Config files are forward-compatible.

-{`$ npm update -g xenvsync -# or +{`$ brew upgrade xenvsync +$ scoop update xenvsync +$ npm update -g @nasimstg/xenvsync $ go install github.com/nasimstg/xenvsync@latest`}
diff --git a/website/src/components/Search.tsx b/website/src/components/Search.tsx index cfbed79..1a71abe 100644 --- a/website/src/components/Search.tsx +++ b/website/src/components/Search.tsx @@ -60,6 +60,15 @@ const searchIndex: SearchEntry[] = [ }, // Installation + { + href: "/docs/installation", + title: "Installation", + section: "Docs", + heading: "Homebrew & Scoop", + keywords: ["homebrew", "brew", "scoop", "windows", "macos", "linux", "tap", "bucket"], + content: + "Install via Homebrew on macOS and Linux with brew install nasimstg/tap/xenvsync. Install via Scoop on Windows with scoop bucket add nasimstg and scoop install xenvsync.", + }, { href: "/docs/installation", title: "Installation", @@ -78,6 +87,15 @@ const searchIndex: SearchEntry[] = [ content: "Prebuilt binaries available on GitHub Releases for Linux macOS Windows. Package manager support with deb and rpm. Download tar.gz or zip from releases page.", }, + { + href: "/docs/installation", + title: "Installation", + section: "Docs", + heading: "Nix & AUR", + keywords: ["nix", "flake", "nixos", "aur", "arch", "linux", "makepkg"], + content: + "Install with Nix using nix run github:nasimstg/xenvsync or add to your flake inputs. Arch Linux users can build from AUR with makepkg.", + }, { href: "/docs/installation", title: "Installation",