Update CI and Docker builds to use MAS_* env vars

Replace VERGEN_GIT_DESCRIBE with MAS_VERSION and --features docker/dist
with MAS_SHARE_DIR environment variable:

- Dockerfile: Set MAS_SHARE_DIR=/usr/local/share/mas-cli
- docker-bake.hcl: Pass MAS_VERSION instead of VERGEN_GIT_DESCRIBE
- build.yaml: Use MAS_VERSION and MAS_SHARE_DIR=./share for dist builds

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Quentin Gliech
2026-02-05 00:22:46 +01:00
parent 2cedbe05d8
commit e08a7d809f
3 changed files with 11 additions and 11 deletions
+3 -4
View File
@@ -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:
+5 -4
View File
@@ -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
+3 -3
View File
@@ -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}"
}
}