From 865874837be48194e825e92178951bdd7859d744 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:52:15 -0700 Subject: [PATCH 01/14] chore: support for ARM64 --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68fb9b09..b2a6a2e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -417,6 +417,9 @@ jobs: run: | ./.github/scripts/update-version.sh ${{ needs.calculate-version.outputs.version }} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3.0.0 + - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0 @@ -467,6 +470,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max + platforms: linux/amd64, linux/arm64 outputs: type=docker,dest=${{ env.DOCKER_IMAGE_TAR_LOCATION }} - name: Upload artifact From d40e4f7901c299a5429579c484e5fbc3c24716dc Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 12:14:26 -0700 Subject: [PATCH 02/14] chore: try OCI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b2a6a2e7..7eea88f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -471,7 +471,7 @@ jobs: cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max platforms: linux/amd64, linux/arm64 - outputs: type=docker,dest=${{ env.DOCKER_IMAGE_TAR_LOCATION }} + outputs: type=oci,dest=${{ env.DOCKER_IMAGE_TAR_LOCATION }} - name: Upload artifact uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 From 87566adcc016b050b52b7749ce47183f7d78e791 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:26:36 -0700 Subject: [PATCH 03/14] chore: build with matrix --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7eea88f2..d4aacee2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -399,19 +399,33 @@ jobs: args: --workspace --all-targets --all-features --no-deps docker-build: - name: Build Docker container + name: Build Docker container for ${{ matrix.platform.docker }} runs-on: ubuntu-latest needs: - calculate-version # if: ... is not needed because calculate-version will not run if we disable building the docker container env: APPLICATION_NAME: PLACEHOLDER # overridden in step 'Set application name', this is merely to satisfy the linter + PLATFORM_PAIR: PLACEHOLDER # same ^ + strategy: + fail-fast: false + matrix: + platform: + - docker: linux/amd64 + rust: x86_64-unknown-linux-musl + - docker: linux/arm64 + rust: aarch64-unknown-linux-musl steps: - name: Checkout uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 with: show-progress: false + - name: Prepare name + run: | + platform=${{ matrix.platform }} + echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + - name: Set the Cargo.toml version before we copy in the data into the Docker container shell: bash run: | @@ -463,21 +477,24 @@ jobs: with: build-args: | APPLICATION_NAME=${{ env.APPLICATION_NAME }} + TARGET=${{ matrix.platform.rust }} context: . # this container is THE PR's artifact, and we will re-tag it # once the PR has been accepted tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache,mode=max - platforms: linux/amd64, linux/arm64 - outputs: type=oci,dest=${{ env.DOCKER_IMAGE_TAR_LOCATION }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.PLATFORM_PAIR }}:buildcache + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.PLATFORM_PAIR }}:buildcache,mode=max + platforms: ${{ matrix.platform.docker }} + outputs: type=oci,dest=/tmp/${{ env.PLATFORM_PAIR }}.tar - name: Upload artifact uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: - name: ${{ env.DOCKER_IMAGE_ARTIFACT_NAME }} - path: ${{ env.DOCKER_IMAGE_TAR_LOCATION }} + name: containers-${{ env.PLATFORM_PAIR }} + path: /tmp/containers/${{ env.PLATFORM_PAIR }}.tar + if-no-files-found: error + retention-days: 1 docker-publish: name: Publish Docker container @@ -497,8 +514,8 @@ jobs: - name: Download artifact uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: - name: ${{ env.DOCKER_IMAGE_ARTIFACT_NAME }} - path: ${{ env.DOCKER_IMAGE_OUTPUT_LOCATION }} + name: containers-* + path: /tmp/containers - name: Log into registry ${{ env.REGISTRY }} uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 @@ -507,10 +524,14 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Load image from artifact + - name: Load images from artifacts shell: bash run: | - docker load --input ${{ env.DOCKER_IMAGE_TAR_LOCATION }} + for container in /tmp/containers/* + do + docker load --input $container + done + - name: Push image with all tags shell: bash From d8cf9747ae7b1c14fa7f70b1f7f612d342d1e31a Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:28:49 -0700 Subject: [PATCH 04/14] fix: platform name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d4aacee2..e679ec7d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -423,7 +423,7 @@ jobs: - name: Prepare name run: | - platform=${{ matrix.platform }} + platform=${{ matrix.platform.docker }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Set the Cargo.toml version before we copy in the data into the Docker container From fa11cb5b76646809cd5de6451a07818bec922b93 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:29:16 -0700 Subject: [PATCH 05/14] chore: also add rust target to name --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e679ec7d..c843e62e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -423,7 +423,7 @@ jobs: - name: Prepare name run: | - platform=${{ matrix.platform.docker }} + platform=${{ matrix.platform.docker }}-${{ matrix.platform.rust }} echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV - name: Set the Cargo.toml version before we copy in the data into the Docker container From 6d1f131d50f29b4e9f58a3ab29cc83da7dd3c0e2 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:33:33 -0700 Subject: [PATCH 06/14] fix: filepaths were wrong --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c843e62e..b82f394a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -399,7 +399,7 @@ jobs: args: --workspace --all-targets --all-features --no-deps docker-build: - name: Build Docker container for ${{ matrix.platform.docker }} + name: Build Docker container for ${{ matrix.platform.docker }}-${{ matrix.platform.rust }} runs-on: ubuntu-latest needs: - calculate-version @@ -492,7 +492,7 @@ jobs: uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: containers-${{ env.PLATFORM_PAIR }} - path: /tmp/containers/${{ env.PLATFORM_PAIR }}.tar + path: /tmp/${{ env.PLATFORM_PAIR }}.tar if-no-files-found: error retention-days: 1 From d8c091de62781eac1789ad4a11889e3fa4559414 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:46:35 -0700 Subject: [PATCH 07/14] fix: use artifact v4 settings --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b82f394a..747c29b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -515,7 +515,8 @@ jobs: uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: name: containers-* - path: /tmp/containers + pattern: /tmp/containers + merge-multiple: true - name: Log into registry ${{ env.REGISTRY }} uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 @@ -532,7 +533,6 @@ jobs: docker load --input $container done - - name: Push image with all tags shell: bash run: | From 3b4513c6dfd7d46a21b41594173de731f9139ece Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:54:52 -0700 Subject: [PATCH 08/14] chore: correct params --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 747c29b1..813dcc33 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -514,8 +514,8 @@ jobs: - name: Download artifact uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 with: - name: containers-* - pattern: /tmp/containers + path: /tmp/containers + pattern: containers-* merge-multiple: true - name: Log into registry ${{ env.REGISTRY }} From 89153e203b481aa34552ffdb093e608138b5bc10 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:58:33 -0700 Subject: [PATCH 09/14] chore: debugging --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 813dcc33..161718f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,9 +25,6 @@ env: # github.repository as / IMAGE_NAME: ${{ github.repository }} # just a name, but storing it separately as we're nice people - DOCKER_IMAGE_ARTIFACT_NAME: Docker image - DOCKER_IMAGE_OUTPUT_LOCATION: /tmp - DOCKER_IMAGE_TAR_LOCATION: /tmp/docker-image.tar # notice /tmp same as DOCKER_IMAGE_OUTPUT_LOCATION RUSTFLAGS: --deny=warnings concurrency: @@ -528,8 +525,10 @@ jobs: - name: Load images from artifacts shell: bash run: | + ls -l /tmp/containers/ for container in /tmp/containers/* do + echo $container docker load --input $container done From 5cff0993fca0e1a278b63e91059474efe6853486 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:03:15 -0700 Subject: [PATCH 10/14] chore: export docker --- .github/workflows/build.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 161718f5..7efadbf6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -104,8 +104,10 @@ jobs: - name: Set up toolchain shell: bash run: | - rm ${HOME}/.cargo/bin/rustfmt rm ${HOME}/.cargo/bin/cargo-fmt + rm ${HOME}/.cargo/bin/rust-analyzer + rm ${HOME}/.cargo/bin/rustfmt + rustup update cargo --version @@ -181,8 +183,10 @@ jobs: - name: Set up toolchain shell: bash run: | - rm ${HOME}/.cargo/bin/rustfmt rm ${HOME}/.cargo/bin/cargo-fmt + rm ${HOME}/.cargo/bin/rust-analyzer + rm ${HOME}/.cargo/bin/rustfmt + rustup update cargo --version @@ -225,8 +229,10 @@ jobs: - name: Set up toolchain shell: bash run: | - rm ${HOME}/.cargo/bin/rustfmt rm ${HOME}/.cargo/bin/cargo-fmt + rm ${HOME}/.cargo/bin/rust-analyzer + rm ${HOME}/.cargo/bin/rustfmt + rustup update cargo --version @@ -267,8 +273,10 @@ jobs: - name: Set up toolchain shell: bash run: | - rm ${HOME}/.cargo/bin/rustfmt rm ${HOME}/.cargo/bin/cargo-fmt + rm ${HOME}/.cargo/bin/rust-analyzer + rm ${HOME}/.cargo/bin/rustfmt + rustup update cargo --version @@ -384,8 +392,10 @@ jobs: - name: Set up toolchain shell: bash run: | - rm ${HOME}/.cargo/bin/rustfmt rm ${HOME}/.cargo/bin/cargo-fmt + rm ${HOME}/.cargo/bin/rust-analyzer + rm ${HOME}/.cargo/bin/rustfmt + rustup update cargo --version @@ -483,7 +493,7 @@ jobs: cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.PLATFORM_PAIR }}:buildcache cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.PLATFORM_PAIR }}:buildcache,mode=max platforms: ${{ matrix.platform.docker }} - outputs: type=oci,dest=/tmp/${{ env.PLATFORM_PAIR }}.tar + outputs: type=docker,dest=/tmp/${{ env.PLATFORM_PAIR }}.tar - name: Upload artifact uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 From e5aa29fb129befd826441db3be17fdb50c368202 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:06:04 +0000 Subject: [PATCH 11/14] chore(deps): pin docker/setup-qemu-action action to 6882732 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7efadbf6..08889d48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -439,7 +439,7 @@ jobs: ./.github/scripts/update-version.sh ${{ needs.calculate-version.outputs.version }} - name: Set up QEMU - uses: docker/setup-qemu-action@v3.0.0 + uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 - name: Set up Docker Buildx id: buildx From 86abe565e109bec11715e46a317c318697a9799b Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:48:34 +0000 Subject: [PATCH 12/14] chore(deps): update npm to >=10.5.1 --- package-lock.json | 137 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 77 insertions(+), 62 deletions(-) diff --git a/package-lock.json b/package-lock.json index af37fa7b..23526285 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ }, "engines": { "node": ">=20.12.0", - "npm": ">=10.5.0" + "npm": ">=10.5.1" } }, "node_modules/@actions/core": { @@ -2318,9 +2318,9 @@ } }, "node_modules/npm": { - "version": "10.5.0", - "resolved": "https://registry.npmjs.org/npm/-/npm-10.5.0.tgz", - "integrity": "sha512-Ejxwvfh9YnWVU2yA5FzoYLTW52vxHCz+MHrOFg9Cc8IFgF/6f5AGPAvb5WTay5DIUP1NIfN3VBZ0cLlGO0Ys+A==", + "version": "10.5.1", + "resolved": "https://registry.npmjs.org/npm/-/npm-10.5.1.tgz", + "integrity": "sha512-RozZuGuWbbhDM2sRhOSLIRb3DLyof6TREi0TW5b3xUEBropDhDqEHv0iAjA1zsIwXKgfIkR8GvQMd4oeKKg9eQ==", "bundleDependencies": [ "@isaacs/string-locale-compare", "@npmcli/arborist", @@ -2329,6 +2329,7 @@ "@npmcli/map-workspaces", "@npmcli/package-json", "@npmcli/promise-spawn", + "@npmcli/redact", "@npmcli/run-script", "@sigstore/tuf", "abbrev", @@ -2409,23 +2410,24 @@ "@npmcli/map-workspaces": "^3.0.4", "@npmcli/package-json": "^5.0.0", "@npmcli/promise-spawn": "^7.0.1", + "@npmcli/redact": "^1.1.0", "@npmcli/run-script": "^7.0.4", - "@sigstore/tuf": "^2.3.1", + "@sigstore/tuf": "^2.3.2", "abbrev": "^2.0.0", "archy": "~1.0.0", "cacache": "^18.0.2", "chalk": "^5.3.0", "ci-info": "^4.0.0", "cli-columns": "^4.0.0", - "cli-table3": "^0.6.3", + "cli-table3": "^0.6.4", "columnify": "^1.6.0", "fastest-levenshtein": "^1.0.16", "fs-minipass": "^3.0.3", - "glob": "^10.3.10", + "glob": "^10.3.12", "graceful-fs": "^4.2.11", "hosted-git-info": "^7.0.1", - "ini": "^4.1.1", - "init-package-json": "^6.0.0", + "ini": "^4.1.2", + "init-package-json": "^6.0.2", "is-cidr": "^5.0.3", "json-parse-even-better-errors": "^3.0.1", "libnpmaccess": "^8.0.1", @@ -2440,11 +2442,11 @@ "libnpmteam": "^6.0.0", "libnpmversion": "^5.0.1", "make-fetch-happen": "^13.0.0", - "minimatch": "^9.0.3", + "minimatch": "^9.0.4", "minipass": "^7.0.4", "minipass-pipeline": "^1.2.4", "ms": "^2.1.2", - "node-gyp": "^10.0.1", + "node-gyp": "^10.1.0", "nopt": "^7.2.0", "normalize-package-data": "^6.0.0", "npm-audit-report": "^5.0.0", @@ -2452,7 +2454,7 @@ "npm-package-arg": "^11.0.1", "npm-pick-manifest": "^9.0.0", "npm-profile": "^9.0.0", - "npm-registry-fetch": "^16.1.0", + "npm-registry-fetch": "^16.2.0", "npm-user-validate": "^2.0.0", "npmlog": "^7.0.1", "p-map": "^4.0.0", @@ -2460,12 +2462,12 @@ "parse-conflict-json": "^3.0.1", "proc-log": "^3.0.0", "qrcode-terminal": "^0.12.0", - "read": "^2.1.0", + "read": "^3.0.1", "semver": "^7.6.0", "spdx-expression-parse": "^3.0.1", "ssri": "^10.0.5", "supports-color": "^9.4.0", - "tar": "^6.2.0", + "tar": "^6.2.1", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "treeverse": "^3.0.0", @@ -2608,7 +2610,7 @@ } }, "node_modules/npm/node_modules/@npmcli/arborist": { - "version": "7.4.0", + "version": "7.4.1", "dev": true, "inBundle": true, "license": "ISC", @@ -2629,12 +2631,12 @@ "hosted-git-info": "^7.0.1", "json-parse-even-better-errors": "^3.0.0", "json-stringify-nice": "^1.1.4", - "minimatch": "^9.0.0", + "minimatch": "^9.0.4", "nopt": "^7.0.0", "npm-install-checks": "^6.2.0", "npm-package-arg": "^11.0.1", "npm-pick-manifest": "^9.0.0", - "npm-registry-fetch": "^16.0.0", + "npm-registry-fetch": "^16.2.0", "npmlog": "^7.0.1", "pacote": "^17.0.4", "parse-conflict-json": "^3.0.0", @@ -2655,14 +2657,14 @@ } }, "node_modules/npm/node_modules/@npmcli/config": { - "version": "8.2.0", + "version": "8.2.1", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "@npmcli/map-workspaces": "^3.0.2", "ci-info": "^4.0.0", - "ini": "^4.1.0", + "ini": "^4.1.2", "nopt": "^7.0.0", "proc-log": "^3.0.0", "read-package-json-fast": "^3.0.2", @@ -2837,6 +2839,15 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/npm/node_modules/@npmcli/redact": { + "version": "1.1.0", + "dev": true, + "inBundle": true, + "license": "ISC", + "engines": { + "node": "^16.14.0 || >=18.0.0" + } + }, "node_modules/npm/node_modules/@npmcli/run-script": { "version": "7.0.4", "dev": true, @@ -2909,7 +2920,7 @@ } }, "node_modules/npm/node_modules/@sigstore/tuf": { - "version": "2.3.1", + "version": "2.3.2", "dev": true, "inBundle": true, "license": "Apache-2.0", @@ -2967,7 +2978,7 @@ } }, "node_modules/npm/node_modules/agent-base": { - "version": "7.1.0", + "version": "7.1.1", "dev": true, "inBundle": true, "license": "MIT", @@ -3055,12 +3066,15 @@ } }, "node_modules/npm/node_modules/binary-extensions": { - "version": "2.2.0", + "version": "2.3.0", "dev": true, "inBundle": true, "license": "MIT", "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/npm/node_modules/brace-expansion": { @@ -3175,7 +3189,7 @@ } }, "node_modules/npm/node_modules/cli-table3": { - "version": "0.6.3", + "version": "0.6.4", "dev": true, "inBundle": true, "license": "MIT", @@ -3453,16 +3467,16 @@ } }, "node_modules/npm/node_modules/glob": { - "version": "10.3.10", + "version": "10.3.12", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "foreground-child": "^3.1.0", - "jackspeak": "^2.3.5", + "jackspeak": "^2.3.6", "minimatch": "^9.0.1", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0", - "path-scurry": "^1.10.1" + "minipass": "^7.0.4", + "path-scurry": "^1.10.2" }, "bin": { "glob": "dist/esm/bin.mjs" @@ -3586,7 +3600,7 @@ } }, "node_modules/npm/node_modules/ini": { - "version": "4.1.1", + "version": "4.1.2", "dev": true, "inBundle": true, "license": "ISC", @@ -3595,15 +3609,15 @@ } }, "node_modules/npm/node_modules/init-package-json": { - "version": "6.0.0", + "version": "6.0.2", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { + "@npmcli/package-json": "^5.0.0", "npm-package-arg": "^11.0.0", "promzard": "^1.0.0", - "read": "^2.0.0", - "read-package-json": "^7.0.0", + "read": "^3.0.1", "semver": "^7.3.5", "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "^5.0.0" @@ -3752,20 +3766,20 @@ "license": "MIT" }, "node_modules/npm/node_modules/libnpmaccess": { - "version": "8.0.2", + "version": "8.0.3", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "npm-package-arg": "^11.0.1", - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^16.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmdiff": { - "version": "6.0.7", + "version": "6.0.8", "dev": true, "inBundle": true, "license": "ISC", @@ -3773,19 +3787,19 @@ "@npmcli/arborist": "^7.2.1", "@npmcli/disparity-colors": "^3.0.0", "@npmcli/installed-package-contents": "^2.0.2", - "binary-extensions": "^2.2.0", + "binary-extensions": "^2.3.0", "diff": "^5.1.0", - "minimatch": "^9.0.0", + "minimatch": "^9.0.4", "npm-package-arg": "^11.0.1", "pacote": "^17.0.4", - "tar": "^6.2.0" + "tar": "^6.2.1" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmexec": { - "version": "7.0.8", + "version": "7.0.9", "dev": true, "inBundle": true, "license": "ISC", @@ -3797,7 +3811,7 @@ "npmlog": "^7.0.1", "pacote": "^17.0.4", "proc-log": "^3.0.0", - "read": "^2.0.0", + "read": "^3.0.1", "read-package-json-fast": "^3.0.2", "semver": "^7.3.7", "walk-up-path": "^3.0.1" @@ -3807,7 +3821,7 @@ } }, "node_modules/npm/node_modules/libnpmfund": { - "version": "5.0.5", + "version": "5.0.6", "dev": true, "inBundle": true, "license": "ISC", @@ -3819,33 +3833,33 @@ } }, "node_modules/npm/node_modules/libnpmhook": { - "version": "10.0.1", + "version": "10.0.2", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^16.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmorg": { - "version": "6.0.2", + "version": "6.0.3", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^16.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmpack": { - "version": "6.0.7", + "version": "6.0.8", "dev": true, "inBundle": true, "license": "ISC", @@ -3860,7 +3874,7 @@ } }, "node_modules/npm/node_modules/libnpmpublish": { - "version": "9.0.4", + "version": "9.0.5", "dev": true, "inBundle": true, "license": "ISC", @@ -3868,7 +3882,7 @@ "ci-info": "^4.0.0", "normalize-package-data": "^6.0.0", "npm-package-arg": "^11.0.1", - "npm-registry-fetch": "^16.0.0", + "npm-registry-fetch": "^16.2.0", "proc-log": "^3.0.0", "semver": "^7.3.7", "sigstore": "^2.2.0", @@ -3879,25 +3893,25 @@ } }, "node_modules/npm/node_modules/libnpmsearch": { - "version": "7.0.1", + "version": "7.0.2", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^16.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" } }, "node_modules/npm/node_modules/libnpmteam": { - "version": "6.0.1", + "version": "6.0.2", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { "aproba": "^2.0.0", - "npm-registry-fetch": "^16.0.0" + "npm-registry-fetch": "^16.2.0" }, "engines": { "node": "^16.14.0 || >=18.0.0" @@ -3951,7 +3965,7 @@ } }, "node_modules/npm/node_modules/minimatch": { - "version": "9.0.3", + "version": "9.0.4", "dev": true, "inBundle": true, "license": "ISC", @@ -4159,7 +4173,7 @@ } }, "node_modules/npm/node_modules/node-gyp": { - "version": "10.0.1", + "version": "10.1.0", "dev": true, "inBundle": true, "license": "MIT", @@ -4310,11 +4324,12 @@ } }, "node_modules/npm/node_modules/npm-registry-fetch": { - "version": "16.1.0", + "version": "16.2.0", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { + "@npmcli/redact": "^1.1.0", "make-fetch-happen": "^13.0.0", "minipass": "^7.0.2", "minipass-fetch": "^3.0.0", @@ -4422,12 +4437,12 @@ } }, "node_modules/npm/node_modules/path-scurry": { - "version": "1.10.1", + "version": "1.10.2", "dev": true, "inBundle": true, "license": "BlueOak-1.0.0", "dependencies": { - "lru-cache": "^9.1.1 || ^10.0.0", + "lru-cache": "^10.2.0", "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" }, "engines": { @@ -4497,12 +4512,12 @@ } }, "node_modules/npm/node_modules/promzard": { - "version": "1.0.0", + "version": "1.0.1", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "read": "^2.0.0" + "read": "^3.0.1" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -4517,12 +4532,12 @@ } }, "node_modules/npm/node_modules/read": { - "version": "2.1.0", + "version": "3.0.1", "dev": true, "inBundle": true, "license": "ISC", "dependencies": { - "mute-stream": "~1.0.0" + "mute-stream": "^1.0.0" }, "engines": { "node": "^14.17.0 || ^16.13.0 || >=18.0.0" @@ -4813,7 +4828,7 @@ } }, "node_modules/npm/node_modules/tar": { - "version": "6.2.0", + "version": "6.2.1", "dev": true, "inBundle": true, "license": "ISC", diff --git a/package.json b/package.json index ff9a3456..0e352216 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "engines": { "node": ">=20.12.0", - "npm": ">=10.5.0" + "npm": ">=10.5.1" }, "repository": { "type": "git", From a1a035aaed173413059cba72ec07a1cae2b6f0d2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:59:05 +0000 Subject: [PATCH 13/14] chore(deps): update node.js to >=20.12.1 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 23526285..26563adf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "semantic-release": "23.0.6" }, "engines": { - "node": ">=20.12.0", + "node": ">=20.12.1", "npm": ">=10.5.1" } }, diff --git a/package.json b/package.json index 0e352216..f42136c7 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "release": "semantic-release" }, "engines": { - "node": ">=20.12.0", + "node": ">=20.12.1", "npm": ">=10.5.1" }, "repository": { From 45196bd6bd8801472a6db0b76278fbeaa54c1ca1 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+Kristof-Mattei@users.noreply.github.com> Date: Tue, 2 Apr 2024 14:31:45 -0700 Subject: [PATCH 14/14] feat: multi-platform images --- .github/workflows/build.yml | 76 ++++++++++++++++++++++++++++--------- 1 file changed, 58 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 08889d48..4f2b28a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,8 +42,8 @@ jobs: steps: - name: Repo has docker container? - id: determine shell: bash + id: determine run: | HAS_CONTAINER="${{ vars.HAS_CONTAINER }}" echo "has_container=${HAS_CONTAINER:-false}" >> ${GITHUB_OUTPUT} @@ -131,8 +131,8 @@ jobs: cargo binstall --no-confirm cocogitto --target x86_64-unknown-linux-musl --pkg-url "{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.tar.gz" --bin-dir "{ bin }" --pkg-fmt tgz - name: Calculate next version - id: version shell: bash + id: version run: | VERSION="$(cog bump --auto --dry-run || true)" @@ -413,7 +413,9 @@ jobs: # if: ... is not needed because calculate-version will not run if we disable building the docker container env: APPLICATION_NAME: PLACEHOLDER # overridden in step 'Set application name', this is merely to satisfy the linter + PATH_TO_TAR: PALCEHOLDER # same ^ PLATFORM_PAIR: PLACEHOLDER # same ^ + PLATFORM_UNIQUE_TAG: PLACEHOLDER # same ^ strategy: fail-fast: false matrix: @@ -431,7 +433,7 @@ jobs: - name: Prepare name run: | platform=${{ matrix.platform.docker }}-${{ matrix.platform.rust }} - echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV + echo "PLATFORM_PAIR=${platform//\//-}" >> ${GITHUB_ENV} - name: Set the Cargo.toml version before we copy in the data into the Docker container shell: bash @@ -442,21 +444,30 @@ jobs: uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0 - name: Set up Docker Buildx - id: buildx uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0 # TODO validate no changes between github.event.pull_request.head.sha and the actual current sha (representing the hypothetical merge) + - name: Lowercase the image name + shell: bash + run: | + echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} + + - name: Set Docker tag + shell: bash + run: | + PLATFORM_UNIQUE_TAG=pr-${{ github.event.pull_request.base.sha }}-${{ github.event.pull_request.head.sha }}-${{ env.PLATFORM_PAIR }} + echo "PLATFORM_UNIQUE_TAG=${PLATFORM_UNIQUE_TAG##*/}" >> ${GITHUB_ENV} + # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata - id: meta uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + id: meta with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=ref,event=pr,suffix=-latest - type=raw,value=pr-${{ github.event.pull_request.base.sha }}-${{ github.event.pull_request.head.sha }} + type=raw,value=${{ env.PLATFORM_UNIQUE_TAG }} labels: | org.opencontainers.image.version=pr-${{ github.event.number }} org.opencontainers.image.source=${{ github.event.pull_request.html_url }} @@ -468,11 +479,6 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Lowercase the image name - shell: bash - run: | - echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} - - name: Set application name shell: bash run: | @@ -481,6 +487,7 @@ jobs: - name: Build Docker image uses: docker/build-push-action@2cdde995de11925a030ce8070c3d77a52ffcf1c0 # v5.3.0 + id: build with: build-args: | APPLICATION_NAME=${{ env.APPLICATION_NAME }} @@ -490,16 +497,16 @@ jobs: # once the PR has been accepted tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.PLATFORM_PAIR }}:buildcache - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-${{ env.PLATFORM_PAIR }}:buildcache,mode=max + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ env.PLATFORM_PAIR }} + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ env.PLATFORM_PAIR }},mode=max platforms: ${{ matrix.platform.docker }} - outputs: type=docker,dest=/tmp/${{ env.PLATFORM_PAIR }}.tar + outputs: type=docker,dest=/tmp/${{ env.PLATFORM_UNIQUE_TAG }}.tar - name: Upload artifact uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: containers-${{ env.PLATFORM_PAIR }} - path: /tmp/${{ env.PLATFORM_PAIR }}.tar + path: /tmp/${{ env.PLATFORM_UNIQUE_TAG }}.tar if-no-files-found: error retention-days: 1 @@ -532,6 +539,11 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Lowercase the image name + shell: bash + run: | + echo "IMAGE_NAME=${IMAGE_NAME,,}" >> ${GITHUB_ENV} + - name: Load images from artifacts shell: bash run: | @@ -540,12 +552,40 @@ jobs: do echo $container docker load --input $container + tag=$(basename -- $container .tar) + echo ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:${tag} + docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${tag} done - - name: Push image with all tags + - name: Extract Docker metadata + uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1 + id: meta + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=pr,suffix=-latest + type=raw,value=pr-${{ github.event.pull_request.base.sha }}-${{ github.event.pull_request.head.sha }} + + - name: Merge images shell: bash + working-directory: /tmp/containers run: | - docker push ${REGISTRY,,}/${IMAGE_NAME,,} --all-tags + # all files in dir + platform_tags=(*) + + # yeet extension + platform_tags=${platform_tags[@]%.tar} + + new_tags="${{ join(steps.meta.outputs.tags, ' ') }}" + new_tags=$(printf -- '--tag %s ' $new_tags) + + expanded_platform_tags=$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:%s ' $platform_tags) + + docker buildx imagetools create $new_tags $expanded_platform_tags + + for new_tag in $(echo "${{ join(steps.meta.outputs.tags, ' ') }}"); do + docker buildx imagetools inspect --raw $new_tag + done all-done: name: All done