diff options
| -rw-r--r-- | .github/workflows/docker.yaml | 8 | ||||
| -rw-r--r-- | parts/deployment.nix | 42 |
2 files changed, 21 insertions, 29 deletions
diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 361d71d..b7a57b4 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - arch: [amd64, arm64v8] + arch: [x86_64, aarch64] # https://github.com/sellout/bash-strict-mode/commit/9bf1d65c2f786a9887facfcb81e06d8b8b5f4667 if: github.event.check_suite.app.name == 'Garnix CI' @@ -85,7 +85,7 @@ jobs: run: | set -eux - architectures=("amd64" "arm64v8") + architectures=("x86_64" "aarch64") for arch in "${architectures[@]}"; do docker load < images/container-"$arch"/*.tar.gz docker tag ${{ env.IMAGE_NAME }}:latest-"$arch" ${{ env.TAG }}-"$arch" @@ -93,7 +93,7 @@ jobs: done docker manifest create ${{ env.TAG }} \ - --amend ${{ env.TAG }}-amd64 \ - --amend ${{ env.TAG }}-arm64v8 + --amend ${{ env.TAG }}-x86_64 \ + --amend ${{ env.TAG }}-aarch64 docker manifest push ${{ env.TAG }} diff --git a/parts/deployment.nix b/parts/deployment.nix index 178ae1b..9fb754e 100644 --- a/parts/deployment.nix +++ b/parts/deployment.nix @@ -17,30 +17,25 @@ crossPkgsFor = lib.fix (finalAttrs: { "x86_64-linux" = { - "amd64" = pkgs.pkgsStatic; - "arm64v8" = pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic; + "x86_64" = pkgs.pkgsStatic; + "aarch64" = pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic; }; "aarch64-linux" = { - "amd64" = pkgs.pkgsCross.musl64; - "arm64v8" = pkgs.pkgsStatic; + "x86_64" = pkgs.pkgsCross.musl64; + "aarch64" = pkgs.pkgsStatic; }; "x86_64-darwin" = { - "amd64" = pkgs.pkgsCross.musl64; - "arm64v8" = pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic; + "x86_64" = pkgs.pkgsCross.musl64; + "aarch64" = pkgs.pkgsCross.aarch64-multiplatform.pkgsStatic; }; "aarch64-darwin" = finalAttrs."x86_64-darwin"; }); - nativeArchFor = { - "amd64" = "x86_64"; - "arm64v8" = "aarch64"; - }; - wieFor = arch: let - target = "${nativeArchFor.${arch}}-unknown-linux-musl"; + target = "${arch}-unknown-linux-musl"; target' = builtins.replaceStrings ["-"] ["_"] target; targetUpper = lib.toUpper target'; @@ -73,22 +68,19 @@ })) ); - toContainer = arch: - assert lib.assertMsg ( - arch == "arch64" -> pkgs.stdenv.isLinux - ) "aarch64 images are only supported on linux!"; - pkgs.dockerTools.buildLayeredImage { - inherit name; - tag = "latest-${arch}"; - contents = [pkgs.dockerTools.caCertificates]; - config.Cmd = [(wieFor arch)]; + containerFor = arch: + pkgs.dockerTools.buildLayeredImage { + inherit name; + tag = "latest-${arch}"; + contents = [pkgs.dockerTools.caCertificates]; + config.Cmd = [(wieFor arch)]; - architecture = crossPkgsFor.${system}.${arch}.go.GOARCH; - }; + architecture = crossPkgsFor.${system}.${arch}.go.GOARCH; + }; in { packages = { - container-amd64 = toContainer "amd64"; - container-arm64v8 = toContainer "arm64v8"; + container-x86_64 = containerFor "x86_64"; + container-aarch64 = containerFor "aarch64"; }; }; } |
