Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions .github/workflows/wf_build_artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,10 @@ jobs:
make build-docker-image ARCH=${{ inputs.GOARCH }}
if: ${{ ( inputs.GOOS == 'linux' ) }}

- name: "Ammend manifest"
run: |
# hack that speeds up build a lot by crosscompiling with nix/go
# and avoiding to use qemu
mkdir tmp && cd tmp
tar xvzf ../result
sed -i 's/amd64/arm64/g' *.json
tar cvzf image *
rm ../result
cp image ../result
shell: bash
if: ${{ ( inputs.GOOS == 'linux' && inputs.GOARCH == 'arm64' ) }}

- name: "Create a new project"
run: |
export NHOST_DOMAIN=staging.nhost.run
export NHOST_CONFIGSERVER_IMAGE=cli:${{ steps.vars.outputs.VERSION }}
export NHOST_CONFIGSERVER_IMAGE=nhost/cli:${{ steps.vars.outputs.VERSION }}

mkdir new-project
cd new-project
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/wf_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ jobs:
export VERSION=${{ steps.vars.outputs.VERSION }}
export CONTAINER_NAME=nhost/cli

docker load < ~/artifacts/cli-docker-image-$VERSION-linux-amd64/result
docker tag cli:$VERSION $CONTAINER_NAME:$VERSION-amd64
skopeo copy --insecure-policy \
dir:/home/runner/artifacts/cli-docker-image-$VERSION-linux-amd64 \
docker-daemon:$CONTAINER_NAME:$VERSION-amd64
docker push $CONTAINER_NAME:$VERSION-amd64

docker load < ~/artifacts/cli-docker-image-$VERSION-linux-arm64/result
docker tag cli:$VERSION $CONTAINER_NAME:$VERSION-arm64
skopeo copy --insecure-policy \
dir:/home/runner/artifacts/cli-docker-image-$VERSION-linux-arm64 \
docker-daemon:$CONTAINER_NAME:$VERSION-arm64
docker push $CONTAINER_NAME:$VERSION-arm64

docker manifest create \
Expand Down
16 changes: 12 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ else
OS?=linux
endif

VER=$(shell echo $(VERSION) | sed -e 's/\//_/g')

ifdef VER
VERSION=$(shell echo $(VER) | sed -e 's/^v//g' -e 's/\//_/g')
else
VERSION=$(shell grep -oP 'version\s*=\s*"\K[^"]+' flake.nix | head -n 1)
endif


.PHONY: check
Expand All @@ -33,10 +38,13 @@ build-docker-image: ## Build docker image
nix build $(docker-build-options) \
.\#packages.$(HOST_ARCH)-linux.docker-image-$(ARCH) \
--print-build-logs
docker load < result
skopeo copy --insecure-policy \
--override-arch $(ARCH) \
dir:./result docker-daemon:nhost/cli:$(VERSION)


.PHONY: get-version
get-version: ## Return version
@echo $(VER) > VERSION
@echo $(VER)
@sed -i '/^\s*version = "0.0.0-dev";/s//version = "${VERSION}";/' flake.nix
@sed -i '/^\s*created = "1970-.*";/s//created = "${shell date --utc '+%Y-%m-%dT%H:%M:%SZ'}";/' flake.nix
@echo $(VERSION)
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/dev/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func CommandUp() *cli.Command { //nolint:funlen
&cli.StringFlag{ //nolint:exhaustruct
Name: flagDashboardVersion,
Usage: "Dashboard version to use",
Value: "nhost/dashboard:2.29.0",
Value: "nhost/dashboard:2.30.0",
EnvVars: []string{"NHOST_DASHBOARD_VERSION"},
},
&cli.StringFlag{ //nolint:exhaustruct
Expand Down
33 changes: 30 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 11 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
nixpkgs.follows = "nixops/nixpkgs";
flake-utils.follows = "nixops/flake-utils";
nix-filter.follows = "nixops/nix-filter";
nix2container.follows = "nixops/nix2container";
};

outputs = { self, nixops, nixpkgs, flake-utils, nix-filter }:
outputs = { self, nixops, nixpkgs, flake-utils, nix-filter, nix2container }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
Expand Down Expand Up @@ -59,11 +60,13 @@
nativeBuildInputs = with pkgs; [
];

nixops-lib = nixops.lib { inherit pkgs; };
nix2containerPkgs = nix2container.packages.${system};
nixops-lib = nixops.lib { inherit pkgs nix2containerPkgs; };

name = "cli";
description = "Nhost CLI";
version = pkgs.lib.fileContents ./VERSION;
version = "0.0.0-dev";
created = "1970-01-01T00:00:00Z";
module = "github.com/nhost/cli";
submodule = ".";

Expand Down Expand Up @@ -92,6 +95,7 @@
buildInputs = with pkgs; [
certbot-full
python312Packages.certbot-dns-route53
skopeo
] ++ checkDeps ++ buildInputs ++ nativeBuildInputs;
};
};
Expand Down Expand Up @@ -142,13 +146,15 @@
});

docker-image-arm64 = nixops-lib.go.docker-image {
inherit name version buildInputs;
inherit name version created buildInputs;
arch = "arm64";

package = cli-arm64-linux;
};

docker-image-amd64 = nixops-lib.go.docker-image {
inherit name version buildInputs;
inherit name version created buildInputs;
arch = "amd64";

package = cli-amd64-linux;
};
Expand Down
Loading