diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7a4ab5..3a7cf74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,8 +15,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - uses: actions/checkout@v4 - - run: git tag ${{ github.event.inputs.version }} - - run: git push origin ${{ github.event.inputs.version }} + - run: | + git tag ${{ github.event.inputs.version }} + git push origin ${{ github.event.inputs.version }} - uses: ncipollo/release-action@v1 with: tag: ${{ github.event.inputs.version }} @@ -28,12 +29,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: goto-bus-stop/setup-zig@v2 - - run: zig build -Doptimize=ReleaseSmall -Dtarget=aarch64-macos -Dname=zup-macos-aarch64 + - run: | + zig build -Doptimize=ReleaseSmall -Dtarget=aarch64-macos + tar -czf zup-macos-aarch64.tar.gz -C zig-out/bin zup + shasum -a 256 zup-macos-aarch64.tar.gz > zup-macos-aarch64.tar.gz.sha256 - uses: ncipollo/release-action@v1 with: tag: ${{ github.event.inputs.version }} + draft: true allowUpdates: true - artifacts: "zig-out/bin/zup-macos-aarch64" + artifacts: "zup-macos-aarch64.tar.gz,zup-macos-aarch64.tar.gz.sha256" macos-x86_64: needs: tag @@ -41,12 +46,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: goto-bus-stop/setup-zig@v2 - - run: zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-macos -Dname=zup-macos-x86_64 + - run: | + zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-macos + tar -czf zup-macos-x86_64.tar.gz -C zig-out/bin zup + shasum -a 256 zup-macos-x86_64.tar.gz > zup-macos-x86_64.tar.gz.sha256 - uses: ncipollo/release-action@v1 with: tag: ${{ github.event.inputs.version }} + draft: true allowUpdates: true - artifacts: "zig-out/bin/zup-macos-x86_64" + artifacts: "zup-macos-x86_64.tar.gz,zup-macos-x86_64.tar.gz.sha256" linux-aarch64: needs: tag @@ -54,12 +63,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: goto-bus-stop/setup-zig@v2 - - run: zig build -Doptimize=ReleaseSmall -Dtarget=aarch64-linux -Dname=zup-linux-aarch64 + - run: | + zig build -Doptimize=ReleaseSmall -Dtarget=aarch64-linux + tar -czf zup-linux-aarch64.tar.gz -C zig-out/bin zup + shasum -a 256 zup-linux-aarch64.tar.gz > zup-linux-aarch64.tar.gz.sha256 - uses: ncipollo/release-action@v1 with: tag: ${{ github.event.inputs.version }} + draft: true allowUpdates: true - artifacts: "zig-out/bin/zup-linux-aarch64" + artifacts: "zup-linux-aarch64.tar.gz,zup-linux-aarch64.tar.gz.sha256" linux-x86_64: needs: tag @@ -67,9 +80,13 @@ jobs: steps: - uses: actions/checkout@v4 - uses: goto-bus-stop/setup-zig@v2 - - run: zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-linux -Dname=zup-linux-x86_64 + - run: | + zig build -Doptimize=ReleaseSmall -Dtarget=x86_64-linux + tar -czf zup-linux-x86_64.tar.gz -C zig-out/bin zup + shasum -a 256 zup-linux-x86_64.tar.gz > zup-linux-x86_64.tar.gz.sha256 - uses: ncipollo/release-action@v1 with: tag: ${{ github.event.inputs.version }} + draft: true allowUpdates: true - artifacts: "zig-out/bin/zup-linux-x86_64" + artifacts: "zup-linux-x86_64.tar.gz,zup-linux-x86_64.tar.gz.sha256" diff --git a/README.md b/README.md index a9cc0bf..b02ea05 100644 --- a/README.md +++ b/README.md @@ -18,42 +18,20 @@ expect it to supersede `zup` at some point. ### Installation -#### Package Managers - -- [x] Homebrew (macOS): `brew tap sdnts/tools && brew install zup` -- [ ] Linux: TBD - -Then, add `~/.zup/bin` to your $PATH (this is where Zup installs toolchains by -default): - -```sh -# sh / bash / zsh -export PATH=$PATH:/home/sid/.zup/bin -``` - -OR - -```fish -# fish -fish_add_path /home/sid/.zup/bin -``` - -#### Prebuilt binaries - -Alternatively, you can download a pre-compiled binary for a supported OS / arch -from the [Releases](https://github.com/sdnts/zup/releases) page and place it in -a location that is in your $PATH. I recommend `~/.zup/bin`, since that is also -where Zup installs toolchains by default. You may also want to rename it to `zup`, -and give it execution permissions by running `chmod +x zup`. +You can download a pre-built binary for a supported OS / arch from the +[Releases](https://github.com/sdnts/zup/releases) page, extract, and +place it in a location that is in your $PATH. I recommend `~/.zup/bin`, since +that is also where Zup installs toolchains by default. You may also have to give +it execution permissions by running `chmod +x zup`. Then, add `~/.zup/bin` to your $PATH: ```sh # sh / bash / zsh export PATH=$PATH:/home/sid/.zup/bin -``` -```fish +#### OR #### + # fish fish_add_path /home/sid/.zup/bin ``` @@ -67,11 +45,9 @@ defaults to `~/.zup` ```sh # sh / bash / zsh export ZUP_PREFIX=/usr/local/.zup -``` -OR +#### OR #### -```fish # fish set -x ZUP_PREFIX /usr/local/.zup ``` @@ -120,6 +96,21 @@ Display all usage instructions: $ zup --help ``` +### Uninstallation + +Uninstallation is a matter of deleting the `zup` binary, as well as all installed +toolchain versions. + +Delete the `zup` binary from wherever you put it initially (run `which zup` to +find out). + +Installed toolchains are not deleted automatically out of an abundance of caution. +If you overrode the `ZUP_PREFIX` environment variable, delete the directory it +points to, and unset the environment variable. Otherwise, delete the `~/.zup` +directory. + +Also don't forget to remove `~/.zup/bin` from your $PATH. + --- ### Development diff --git a/build.zig b/build.zig index 8c5d074..162e15a 100644 --- a/build.zig +++ b/build.zig @@ -4,10 +4,8 @@ pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{}); - // Argument to override binary name. Used in "Release" GitHub Action. - const bin_name = b.option([]const u8, "name", "Name of the binary on disk"); const exe = b.addExecutable(.{ - .name = bin_name orelse "zup", + .name = "zup", .root_source_file = .{ .path = "src/main.zig" }, .target = target, .optimize = optimize,