From bef1dcb3f67ba6ead24869422c1940277416676b Mon Sep 17 00:00:00 2001 From: Everett Pompeii Date: Fri, 29 Nov 2024 14:44:34 -0500 Subject: [PATCH] bin_version --- services/cli/templates/install-cli.ps1.j2 | 2 +- services/cli/templates/install-cli.sh.j2 | 2 +- services/cli/templates/output/install-cli.ps1 | 4 ++-- services/cli/templates/output/install-cli.sh | 8 ++++---- .../chunks/general/cli-unix-script-version.mdx | 2 +- .../content/onboard/en/install-cli-version.mdx | 2 +- .../console/src/pages/console/onboard/run.astro | 4 +++- tasks/gen_installer/src/task/template.rs | 15 ++++++--------- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/services/cli/templates/install-cli.ps1.j2 b/services/cli/templates/install-cli.ps1.j2 index 07a927903..dc5ab3d09 100644 --- a/services/cli/templates/install-cli.ps1.j2 +++ b/services/cli/templates/install-cli.ps1.j2 @@ -55,7 +55,7 @@ function Install-Binary($install_args) { $platforms = @{ {%- for artifact in artifacts %} "{{ artifact.target_triple }}" = @{ - "artifact_name" = "{{ artifact.name }}" + "artifact_name" = "$app_name-v$app_version-{{ artifact.os_arch }}.exe" "zip_ext" = "{{ artifact.zip_style }}" "bins" = {% for bin in artifact.binaries -%} "{{ bin }}"{{ ", " if not loop.last else "" }} diff --git a/services/cli/templates/install-cli.sh.j2 b/services/cli/templates/install-cli.sh.j2 index 8be23f37a..a2e29cced 100644 --- a/services/cli/templates/install-cli.sh.j2 +++ b/services/cli/templates/install-cli.sh.j2 @@ -127,7 +127,7 @@ download_binary_and_run_installer() { # Lookup what to download/unpack based on platform case "$_arch" in {% for artifact in artifacts %} "{{ artifact.target_triple }}") - _artifact_name="{{ artifact.name }}" + _artifact_name="$APP_NAME-v${APP_VERSION}-{{ artifact.os_arch }}" _zip_ext="{{ artifact.zip_style }}" _bins="{% for bin in artifact.binaries %}{{ bin }}{{ " " if not loop.last else "" }}{% endfor %}" _bin="{{ artifact.binaries[0] }}" diff --git a/services/cli/templates/output/install-cli.ps1 b/services/cli/templates/output/install-cli.ps1 index 7c1dbbc71..c169048f8 100755 --- a/services/cli/templates/output/install-cli.ps1 +++ b/services/cli/templates/output/install-cli.ps1 @@ -54,13 +54,13 @@ function Install-Binary($install_args) { $platforms = @{ "x86_64-pc-windows-msvc" = @{ - "artifact_name" = "bencher-v0.4.28-windows-x86-64.exe" + "artifact_name" = "$app_name-v$app_version-windows-x86-64.exe" "zip_ext" = "" "bins" = "bencher" "bin" = "bencher" } "aarch64-pc-windows-msvc" = @{ - "artifact_name" = "bencher-v0.4.28-windows-arm-64.exe" + "artifact_name" = "$app_name-v$app_version-windows-arm-64.exe" "zip_ext" = "" "bins" = "bencher" "bin" = "bencher" diff --git a/services/cli/templates/output/install-cli.sh b/services/cli/templates/output/install-cli.sh index de76f3c6b..bea3ef586 100755 --- a/services/cli/templates/output/install-cli.sh +++ b/services/cli/templates/output/install-cli.sh @@ -127,25 +127,25 @@ download_binary_and_run_installer() { # Lookup what to download/unpack based on platform case "$_arch" in "x86_64-unknown-linux-gnu") - _artifact_name="bencher-v0.4.28-linux-x86-64" + _artifact_name="$APP_NAME-v${APP_VERSION}-linux-x86-64" _zip_ext="" _bins="bencher" _bin="bencher" ;; "aarch64-unknown-linux-gnu") - _artifact_name="bencher-v0.4.28-linux-arm-64" + _artifact_name="$APP_NAME-v${APP_VERSION}-linux-arm-64" _zip_ext="" _bins="bencher" _bin="bencher" ;; "x86_64-apple-darwin") - _artifact_name="bencher-v0.4.28-macos-x86-64" + _artifact_name="$APP_NAME-v${APP_VERSION}-macos-x86-64" _zip_ext="" _bins="bencher" _bin="bencher" ;; "aarch64-apple-darwin") - _artifact_name="bencher-v0.4.28-macos-arm-64" + _artifact_name="$APP_NAME-v${APP_VERSION}-macos-arm-64" _zip_ext="" _bins="bencher" _bin="bencher" diff --git a/services/console/src/chunks/general/cli-unix-script-version.mdx b/services/console/src/chunks/general/cli-unix-script-version.mdx index 1719b70cf..80a00d08d 100644 --- a/services/console/src/chunks/general/cli-unix-script-version.mdx +++ b/services/console/src/chunks/general/cli-unix-script-version.mdx @@ -1,3 +1,3 @@ ```sh -BENCHER_VERSION=0.4.28 curl --proto '=https' --tlsv1.2 -sSfL https://bencher.dev/download/install-cli.sh | sh +export BENCHER_VERSION=0.4.28; curl --proto '=https' --tlsv1.2 -sSfL https://bencher.dev/download/install-cli.sh | sh ``` diff --git a/services/console/src/content/onboard/en/install-cli-version.mdx b/services/console/src/content/onboard/en/install-cli-version.mdx index de048db58..246088665 100644 --- a/services/console/src/content/onboard/en/install-cli-version.mdx +++ b/services/console/src/content/onboard/en/install-cli-version.mdx @@ -16,7 +16,7 @@ For Linux, Mac, and other Unix-like systems run the following in your terminal:
-BENCHER_VERSION={BENCHER_VERSION} curl --proto '=https' --tlsv1.2 -sSfL https://bencher.dev/download/install-cli.sh | sh
+export BENCHER_VERSION={BENCHER_VERSION}; curl --proto '=https' --tlsv1.2 -sSfL https://bencher.dev/download/install-cli.sh | sh
 
diff --git a/services/console/src/pages/console/onboard/run.astro b/services/console/src/pages/console/onboard/run.astro index 46b1a45b0..9131180f9 100644 --- a/services/console/src/pages/console/onboard/run.astro +++ b/services/console/src/pages/console/onboard/run.astro @@ -16,7 +16,9 @@ const BENCHER_API_URL = import.meta.env.BENCHER_API_URL; const collection = Collection.onboard; const cloudPage = await getEntry(collection, "en/install-cli"); const selfHostedPage = await getEntry(collection, "en/install-cli-version"); -const { Content } = isBencherCloud() ? await cloudPage.render() : await selfHostedPage.render(); +const { Content } = isBencherCloud() + ? await cloudPage.render() + : await selfHostedPage.render(); --- String { - format!("bencher-v{API_VERSION}-{os_arch}") -} const BENCHER_BIN: &str = "bencher"; impl TemplateKind { @@ -131,8 +128,8 @@ impl TemplateKind { fn as_artifact(&(target_triple, os_arch): &(&str, &str)) -> TemplateArtifact { TemplateArtifact { - name: artifact_name(os_arch), - target_triple: (target_triple).to_owned(), + target_triple: target_triple.to_owned(), + os_arch: os_arch.to_owned(), binaries: vec![BENCHER_BIN.to_owned()], zip_style: ZipStyle::TempDir, } @@ -159,10 +156,10 @@ impl TemplateContext { #[derive(Debug, Serialize)] pub struct TemplateArtifact { - /// The name of the artifact - name: String, /// The targets the artifact supports target_triple: TargetTriple, + /// The OS architecture + os_arch: String, /// The binaries the artifact contains (name, assumed at root) binaries: Vec, /// The style of zip this is