Skip to content

Commit

Permalink
Fix install script
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Nov 7, 2023
1 parent 763de15 commit c800d5a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
```
<details>
<summary>(Click to expand) Usage in <code>Dockerfile</code></summary>
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
```
</summary>
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
```
#################################################
# #
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mni2mz3"
version = "1.0.0-rc.1"
version = "1.0.0-rc.2"
edition = "2021"

authors = ["Jennings Zhang <[email protected]>"]
Expand Down

0 comments on commit c800d5a

Please sign in to comment.