diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 42cbace21..4bc9e8331 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -105,7 +105,8 @@ jobs: - target: aarch64-unknown-linux-gnu env: - VERGEN_GIT_DESCRIBE: ${{ needs.compute-version.outputs.describe }} + MAS_VERSION: ${{ needs.compute-version.outputs.describe }} + MAS_SHARE_DIR: ./share SOURCE_DATE_EPOCH: ${{ needs.compute-version.outputs.timestamp }} permissions: @@ -139,8 +140,6 @@ jobs: cargo zigbuild \ --release \ --target ${{ matrix.target }}.2.17 \ - --no-default-features \ - --features dist \ -p mas-cli - name: Upload binary artifact @@ -222,7 +221,7 @@ jobs: arch: [amd64, arm64] env: - VERGEN_GIT_DESCRIBE: ${{ needs.compute-version.outputs.describe }} + MAS_VERSION: ${{ needs.compute-version.outputs.describe }} SOURCE_DATE_EPOCH: ${{ needs.compute-version.outputs.timestamp }} steps: diff --git a/Dockerfile b/Dockerfile index 1998779da..cee999cab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -116,8 +116,11 @@ WORKDIR /app COPY ./ /app ENV SQLX_OFFLINE=true -ARG VERGEN_GIT_DESCRIBE -ENV VERGEN_GIT_DESCRIBE=${VERGEN_GIT_DESCRIBE} +ARG MAS_VERSION +ENV MAS_VERSION=${MAS_VERSION} + +# Set the share directory for the Docker build +ENV MAS_SHARE_DIR=/usr/local/share/mas-cli ARG TARGETARCH @@ -134,8 +137,6 @@ RUN --network=default \ --locked \ --release \ --bin mas-cli \ - --no-default-features \ - --features docker \ --target "${RUST_TARGET}" \ && mv "target/${RUST_TARGET}/release/mas-cli" /usr/local/bin/mas-cli diff --git a/docker-bake.hcl b/docker-bake.hcl index 6f6879e1a..966bd3920 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -7,7 +7,7 @@ // This is used to set the version reported by the binary through an environment // variable. This is mainly useful when building out of a git context, like in // CI, where we don't have the full commit history available -variable "VERGEN_GIT_DESCRIBE" {} +variable "MAS_VERSION" {} // This is what is baked by GitHub Actions group "default" { targets = ["regular", "debug"] } @@ -24,8 +24,8 @@ target "base" { // present, as we may be infering the version at build time out of it BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1 - // Pass down the version from an external git describe source - VERGEN_GIT_DESCRIBE = "${VERGEN_GIT_DESCRIBE}" + // Pass down the version from an external source + MAS_VERSION = "${MAS_VERSION}" } }