Skip to content

Commit

Permalink
bin_version
Browse files Browse the repository at this point in the history
  • Loading branch information
epompeii committed Nov 29, 2024
1 parent a80768d commit bef1dcb
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion services/cli/templates/install-cli.ps1.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 "" }}
Expand Down
2 changes: 1 addition & 1 deletion services/cli/templates/install-cli.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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] }}"
Expand Down
4 changes: 2 additions & 2 deletions services/cli/templates/output/install-cli.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 4 additions & 4 deletions services/cli/templates/output/install-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
@@ -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
```
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ For Linux, Mac, and other Unix-like systems run the following in your terminal:

<code>
<pre>
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
</pre>
</code>

Expand Down
4 changes: 3 additions & 1 deletion services/console/src/pages/console/onboard/run.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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();
---

<BaseLayout
Expand Down
15 changes: 6 additions & 9 deletions tasks/gen_installer/src/task/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,9 @@ const SH_ARTIFACTS: &[(&str, &str)] = &[
("aarch64-apple-darwin", "macos-arm-64"),
];
const PS1_ARTIFACTS: &[(&str, &str)] = &[
("x86_64-pc-windows-msvc", "windows-x86-64.exe"),
("aarch64-pc-windows-msvc", "windows-arm-64.exe"),
("x86_64-pc-windows-msvc", "windows-x86-64"),
("aarch64-pc-windows-msvc", "windows-arm-64"),
];
fn artifact_name(os_arch: &str) -> String {
format!("bencher-v{API_VERSION}-{os_arch}")
}
const BENCHER_BIN: &str = "bencher";

impl TemplateKind {
Expand All @@ -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,
}
Expand All @@ -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<String>,
/// The style of zip this is
Expand Down

0 comments on commit bef1dcb

Please sign in to comment.