diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 7f56b1d..0f857b4 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -14,6 +14,7 @@ jobs: base: uses: "tweedegolf/actions-container-helpers/.github/workflows/container-image.yml@main" with: + artifact: artifact push: ${{ github.ref == 'refs/heads/main' }} platforms: "linux/amd64,linux/arm64" build-args: | diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index f2769b5..6616e97 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -4,7 +4,7 @@ on: workflow_call: jobs: - prebuild_binaries: + prebuild-binaries: runs-on: ubuntu-latest steps: - name: Setup Rust toolchain @@ -36,6 +36,8 @@ jobs: EOF cross build --release --target aarch64-unknown-linux-gnu --no-default-features --features "postgres, sqlite-bundled" cross build --release --target x86_64-unknown-linux-gnu --no-default-features --features "postgres, sqlite-bundled" + mv target/aarch64-unknown-linux-gnu target/arm64 + mv target/x86_64-unknown-linux-gnu target/amd64 - name: Download and build cargo-llvm-lines run: | @@ -43,34 +45,37 @@ jobs: cd cargo-llvm-lines cross build --release --target aarch64-unknown-linux-gnu cross build --release --target x86_64-unknown-linux-gnu + mv target/aarch64-unknown-linux-gnu target/arm64 + mv target/x86_64-unknown-linux-gnu target/amd64 - name: Upload artifacts uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 with: name: artifact path: | - diesel_cli/target/x86_64-unknown-linux-gnu/release/diesel - diesel_cli/target/aarch64-unknown-linux-gnu/release/diesel - cargo-llvm-lines/target/x86_64-unknown-linux-gnu/release/cargo-llvm-lines - cargo-llvm-lines/target/aarch64-unknown-linux-gnu/release/cargo-llvm-lines + diesel_cli/target/amd64/release/diesel + diesel_cli/target/arm64/release/diesel + cargo-llvm-lines/target/amd64/release/cargo-llvm-lines + cargo-llvm-lines/target/arm64/release/cargo-llvm-lines if-no-files-found: error - # build: - # strategy: - # matrix: - # include: - # - version: stable - # latest: false - # - version: beta - # latest: false - # - version: nightly - # latest: false - # - version: 1.77 - # latest: true - # - version: 1.76 - # latest: false - # uses: "./.github/workflows/docker-images.yml" - # with: - # version: ${{ matrix.version }} - # latest: ${{ matrix.latest }} - # node_version: "20" + build: + needs: [prebuild-binaries] + strategy: + matrix: + include: + - version: stable + latest: false + - version: beta + latest: false + - version: nightly + latest: false + - version: 1.77 + latest: true + - version: 1.76 + latest: false + uses: "./.github/workflows/docker-images.yml" + with: + version: ${{ matrix.version }} + latest: ${{ matrix.latest }} + node_version: "20" diff --git a/Dockerfile b/Dockerfile index da2dbb5..a5afeb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,6 +64,9 @@ RUN set -eux; \ cargo --version; \ rustc --version; +COPY diesel_cli/target/$TARGETARCH/release/diesel /usr/local/cargo/bin/diesel +COPY cargo-llvm-lines/target/$TARGETARCH/release/cargo-llvm-lines /usr/local/cargo/bin/cargo-llvm-lines + ARG SCCACHE_VERSION ENV SCCACHE_VERSION ${SCCACHE_VERSION} @@ -131,7 +134,6 @@ RUN set -eux; \ cargo-audit \ cargo-outdated \ cargo-bloat \ - cargo-llvm-lines \ cargo-llvm-cov \ cargo-watch \ cargo-edit \ @@ -151,11 +153,12 @@ RUN set -eux; \ cargo sweep --version; \ cargo chef --version; \ cargo upgrade --version; \ - cargo llvm-lines --version; \ cargo llvm-cov --version; \ cargo bloat --version; \ cargo outdated --version; \ - cargo audit --version; + cargo audit --version; \ + diesel --version; \ + cargo llvm-lines --version; ARG CARGO_UDEPS_VERSION ENV CARGO_UDEPS_VERSION ${CARGO_UDEPS_VERSION} @@ -184,5 +187,3 @@ RUN set -eux; \ rm -rf "/tmp/cargo-udeps-v${CARGO_UDEPS_VERSION}-${udepsArch}/"; \ rm -rf "/tmp/cargo-udeps-v${CARGO_UDEPS_VERSION}-${udepsArch}.tar.gz"; \ cargo udeps --version; - -RUN cargo install diesel_cli --no-default-features --features "postgres sqlite"