From 359bd4eaf1ceb061c7379a37dcaa7813008d26f1 Mon Sep 17 00:00:00 2001 From: Maxence Maireaux Date: Thu, 8 Oct 2026 12:43:39 +0200 Subject: [PATCH] chore(release): adopt shared GoReleaser Docker v2 preset --- .goreleaser.yml | 12 ++++++------ build.Dockerfile | 3 ++- flake.lock | 49 ++++++++++++---------------------------------- flake.nix | 12 ++++++------ scratch.Dockerfile | 3 ++- 5 files changed, 28 insertions(+), 51 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 49f1a2a7..c089ae1c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,7 +4,7 @@ project_name: fctl includes: - from_url: - url: https://raw.githubusercontent.com/formancehq/earthly/refs/heads/main/.goreleaser.default.yaml + url: https://raw.githubusercontent.com/formancehq/earthly/refs/heads/main/.goreleaser.default-v2.yaml builds: - binary: fctl @@ -30,12 +30,12 @@ builds: archives: - id: "{{.ProjectName}}" - builds: + ids: - fctl format_overrides: - goos: windows - format: zip - format: tar.gz + formats: [zip] + formats: [tar.gz] name_template: "{{.ProjectName}}_{{.Os}}-{{.Arch}}" files: - completions/* @@ -87,7 +87,7 @@ nfpms: - id: packages package_name: fctl file_name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" - builds: + ids: - fctl homepage: https://formance.com maintainer: Maxence Maireaux @@ -95,7 +95,7 @@ nfpms: - deb - rpm -furies: +gemfury: - account: formance ids: - packages diff --git a/build.Dockerfile b/build.Dockerfile index 67ea927d..cd270af4 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -1,4 +1,5 @@ FROM ghcr.io/formancehq/base:22.04 -COPY fctl /usr/bin/fctl +ARG TARGETPLATFORM +COPY $TARGETPLATFORM/fctl /usr/bin/fctl ENV OTEL_SERVICE_NAME fctl ENTRYPOINT ["/usr/bin/fctl"] diff --git a/flake.lock b/flake.lock index 75f45daf..049c3e86 100644 --- a/flake.lock +++ b/flake.lock @@ -1,23 +1,19 @@ { "nodes": { - "flake-parts": { - "inputs": { - "nixpkgs-lib": [ - "nur", - "nixpkgs" - ] - }, + "goreleaser": { + "flake": false, "locked": { - "lastModified": 1733312601, - "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "lastModified": 1789616489, + "narHash": "sha256-VrxdD+TQcof1UsIKNgVow5sQLUATDaT+EwsMLS0awVo=", + "owner": "goreleaser", + "repo": "nur", + "rev": "52282e9a2d7c6882e9e0e8675d593b928c89e323", "type": "github" }, "original": { - "owner": "hercules-ci", - "repo": "flake-parts", + "owner": "goreleaser", + "repo": "nur", + "rev": "52282e9a2d7c6882e9e0e8675d593b928c89e323", "type": "github" } }, @@ -49,32 +45,11 @@ "url": "https://flakehub.com/f/NixOS/nixpkgs/0.1" } }, - "nur": { - "inputs": { - "flake-parts": "flake-parts", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1775221564, - "narHash": "sha256-O2/JCtH6VPVypyshKEqW7hKvypvxvjwWBclI89wZJO8=", - "owner": "nix-community", - "repo": "NUR", - "rev": "6ac8a11735e3f5cda30adb1527cb7def63e7100a", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "NUR", - "type": "github" - } - }, "root": { "inputs": { + "goreleaser": "goreleaser", "nixpkgs": "nixpkgs", - "nixpkgs-unstable": "nixpkgs-unstable", - "nur": "nur" + "nixpkgs-unstable": "nixpkgs-unstable" } } }, diff --git a/flake.nix b/flake.nix index 2d426f58..a06fd20e 100644 --- a/flake.nix +++ b/flake.nix @@ -5,13 +5,13 @@ nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2511"; nixpkgs-unstable.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1"; - nur = { - url = "github:nix-community/NUR"; - inputs.nixpkgs.follows = "nixpkgs"; + goreleaser = { + url = "github:goreleaser/nur/52282e9a2d7c6882e9e0e8675d593b928c89e323"; + flake = false; }; }; - outputs = { self, nixpkgs, nixpkgs-unstable, nur }: + outputs = { self, nixpkgs, nixpkgs-unstable, goreleaser }: let supportedSystems = [ "x86_64-linux" @@ -25,7 +25,7 @@ let pkgs = import nixpkgs { inherit system; - overlays = [ nur.overlays.default ]; + overlays = [ ]; config.allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [ "goreleaser-pro" ]; @@ -102,7 +102,7 @@ openapi-generator-cli ]; otherPackages = [ - pkgs.nur.repos.goreleaser.goreleaser-pro + (pkgs.callPackage "${goreleaser}/pkgs/goreleaser-pro" { }) self.packages.${system}.speakeasy ]; in diff --git a/scratch.Dockerfile b/scratch.Dockerfile index a0ae2907..420d3db4 100644 --- a/scratch.Dockerfile +++ b/scratch.Dockerfile @@ -1,4 +1,5 @@ FROM ghcr.io/formancehq/base:scratch -COPY fctl /usr/bin/fctl +ARG TARGETPLATFORM +COPY $TARGETPLATFORM/fctl /usr/bin/fctl ENV OTEL_SERVICE_NAME fctl ENTRYPOINT ["/usr/bin/fctl"]