From c800d5a97c11e42a197935392324e2d4de8ffaf4 Mon Sep 17 00:00:00 2001 From: Jennings Zhang Date: Tue, 7 Nov 2023 16:40:54 -0600 Subject: [PATCH] Fix install script --- .github/workflows/release.yml | 21 +++++++++++++-------- Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e924db0..ef62a0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -163,7 +163,7 @@ jobs: echo "bin_env_var_name=$bin_env_var_name" >> "$GITHUB_OUTPUT" cat > release/installer.sh << EOF - #!/bin/sh + #!/bin/bash # Yet-another SH installer for Rust binaries from GitHub releases. # The binary gets installed to /usr/local/bin, or a custom location specified by $bin_env_var_name @@ -190,7 +190,7 @@ jobs: NAME='$repo_name' file="\$NAME-\$arch-\$os-\$VERSION_TAG.tgz" - url="https://${{ github.server_url }}/\$REPO/releases/download/\$VERSION_TAG/\$file" + url="${{ github.server_url }}/\$REPO/releases/download/\$VERSION_TAG/\$file" tmpdir="\$(mktemp -d)" cd "\$tmpdir" @@ -226,18 +226,23 @@ jobs: body: | A script is provided for downloading and installing the binary. + Install for all users (requires `sudo`): + ```shell - curl --proto '=https' --tlsv1.2 -LsSf 'https://${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/installer.sh | env ${{ steps.create_script.outputs.bin_env_var_name }}=/usr/local/bin/mni2mz3 sh + curl --proto '=https' --tlsv1.2 -LsSf '${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/installer.sh' | sudo env ${{ steps.create_script.outputs.bin_env_var_name }}=/usr/local/bin/mni2mz3 bash ``` -
- (Click to expand) Usage in Dockerfile + Install for current user: - ```Dockerfile - RUN curl --proto '=https' --tlsv1.2 -LsSf 'https://${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/installer.sh | sh + ```shell + curl --proto '=https' --tlsv1.2 -LsSf '${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/installer.sh' | env ${{ steps.create_script.outputs.bin_env_var_name }}="$HOME/.local/bin/mni2mz3" bash ``` - + Use in `Dockerfile` (requires `bash` and `curl`): + + ```Dockerfile + RUN curl --proto '=https' --tlsv1.2 -LsSf '${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/installer.sh' | bash + ``` ################################################# # # diff --git a/Cargo.lock b/Cargo.lock index d6a2203..79d90c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -227,7 +227,7 @@ dependencies = [ [[package]] name = "mni2mz3" -version = "1.0.0-rc.1" +version = "1.0.0-rc.2" dependencies = [ "approx", "flate2", diff --git a/Cargo.toml b/Cargo.toml index fcbfd36..2b673dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mni2mz3" -version = "1.0.0-rc.1" +version = "1.0.0-rc.2" edition = "2021" authors = ["Jennings Zhang "]