diff --git a/.editorconfig b/.editorconfig index b06188f760..ce3c7a7a13 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,7 +2,7 @@ indent_style = space indent_size = 4 -[{*.sh,.mise/tasks/**/*,e2e/**/*}] +[{*.sh,.mise/tasks/**/*,e2e/**/*,*.pkl}] indent_style = space indent_size = 2 diff --git a/.shellcheckrc b/.shellcheckrc index 8cc152d0a2..06d39494eb 100644 --- a/.shellcheckrc +++ b/.shellcheckrc @@ -1,3 +1,4 @@ disable=SC1008 disable=SC2088 +disable=SC2164 disable=SC2317 diff --git a/docs/configuration.md b/docs/configuration.md index a8a7e2b106..a528354f5f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -129,7 +129,7 @@ min_version = '2024.11.1' ### `mise.toml` schema -- You can find the JSON schema for `mise.toml` [here](https://github.com/jdx/mise/blob/main/schema/mise.json) or at . +- You can find the JSON schema for `mise.toml` in [schema/mise.json](https://github.com/jdx/mise/blob/main/schema/mise.json) or at . - Some editors can load it automatically to provide autocompletion and validation for when editing a `mise.toml` file ([VSCode](https://code.visualstudio.com/docs/languages/json#_json-schemas-and-settings), [IntelliJ](https://www.jetbrains.com/help/idea/json.html#ws_json_using_schemas), [neovim](https://github.com/b0o/SchemaStore.nvim), etc.). It is also available in the [JSON schema store](https://www.schemastore.org/json/). - Note that for `included tasks` (see [task configuration](/tasks/task-configuration), there is another schema: ) diff --git a/docs/dev-tools/backends/pipx.md b/docs/dev-tools/backends/pipx.md index 3b040fc315..997cb8a935 100644 --- a/docs/dev-tools/backends/pipx.md +++ b/docs/dev-tools/backends/pipx.md @@ -31,7 +31,7 @@ mise use -g python pip install --user pipx ``` -Other installation instructions can be found [here](https://pipx.pypa.io/latest/installation/) +[Other installation instructions](https://pipx.pypa.io/latest/installation/) ## Usage diff --git a/docs/faq.md b/docs/faq.md index ed42e7e977..9526ebada1 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -101,7 +101,7 @@ We maintain [an index](https://github.com/mise-plugins/registry) of shorthands t base. This is regularly updated every time that mise has a release. This repository is stored directly into -the codebase [here](https://github.com/jdx/mise/blob/main/registry.toml). +the codebase in [registry.toml](https://github.com/jdx/mise/blob/main/registry.toml). ## Does "node@20" mean the newest available version of node? diff --git a/docs/templates.md b/docs/templates.md index c936e95146..702ea237fa 100644 --- a/docs/templates.md +++ b/docs/templates.md @@ -88,7 +88,7 @@ Tera also supports powerful [expressions](https://keats.github.io/tera/docs/#exp - in checking, e.g. `{{ some_var in [1, 2, 3] }}` Tera also supports control structures such as `if` and -`for`. Read more [here](https://keats.github.io/tera/docs/#control-structures). +`for`. [Read more](https://keats.github.io/tera/docs/#control-structures). ### Tera Filters diff --git a/e2e/assert.sh b/e2e/assert.sh index 1025b6e14d..c37c3afd05 100755 --- a/e2e/assert.sh +++ b/e2e/assert.sh @@ -9,7 +9,7 @@ fail() { } # Safeguard against running the test directly, which would execute in the actual user home -[[ -n "${TEST_NAME:-}" ]] || fail "tests should be called using run_test" +[[ -n ${TEST_NAME:-} ]] || fail "tests should be called using run_test" quiet_assert_succeed() { local status=0 @@ -37,7 +37,7 @@ assert_succeed() { assert_fail() { local actual actual="$(quiet_assert_fail "$1")" - if [[ -z "${2:-}" ]]; then + if [[ -z ${2:-} ]]; then ok "[$1] expected failure" elif [[ $actual == *"$2"* ]]; then ok "[$1] output is equal to '$2'" @@ -49,7 +49,7 @@ assert_fail() { assert() { local actual actual="$(quiet_assert_succeed "$1")" - if [[ -z "${2:-}" ]]; then + if [[ -z ${2:-} ]]; then ok "[$1]" elif [[ $actual == "$2" ]]; then ok "[$1] output is equal to '$2'" @@ -89,7 +89,7 @@ assert_json_partial_array() { actual_filtered="$(jq -S "$filter" <<<"$actual")" expected_filtered="$(jq -S "$filter" <<<"$expected")" - if [[ "$actual_filtered" == "$expected_filtered" ]]; then + if [[ $actual_filtered == "$expected_filtered" ]]; then ok "[$command] partial array match successful" else echo "Expected:" @@ -113,7 +113,7 @@ assert_json_partial_object() { actual_filtered="$(jq -S --arg fields "$fields" "$filter" <<<"$actual")" expected_filtered="$(jq -S --arg fields "$fields" "$filter" <<<"$expected")" - if [[ "$actual_filtered" == "$expected_filtered" ]]; then + if [[ $actual_filtered == "$expected_filtered" ]]; then ok "[$command] partial object match successful" else echo "Expected:" @@ -168,7 +168,7 @@ assert_matches() { assert_empty() { local actual actual="$(quiet_assert_succeed "$1")" - if [[ -z "$actual" ]]; then + if [[ -z $actual ]]; then ok "[$1] output is empty" else fail "[$1] expected empty output but got '$actual'" @@ -176,7 +176,7 @@ assert_empty() { } assert_directory_exists() { - if [[ -d "$1" ]]; then + if [[ -d $1 ]]; then ok "[$1] directory exists" else fail "[$1] directory does not exist" @@ -184,7 +184,7 @@ assert_directory_exists() { } assert_directory_not_exists() { - if [[ ! -d "$1" ]]; then + if [[ ! -d $1 ]]; then ok "[$1] directory does not exist" else fail "[$1] directory exists" diff --git a/e2e/backend/test_ubi b/e2e/backend/test_ubi index 851c43378c..e0963fc880 100644 --- a/e2e/backend/test_ubi +++ b/e2e/backend/test_ubi @@ -7,7 +7,7 @@ assert_contains "$MISE_DATA_DIR/shims/jc --version" "jc version: 1.25.3" # only run on linux/amd64 if [ "$(uname -m)" = "x86_64" ] && [ "$(uname -s)" = "Linux" ]; then - mise use ubi:https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz[exe=ffmpeg] + mise use 'ubi:https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz[exe=ffmpeg]' assert_contains "$MISE_DATA_DIR/shims/ffmpeg -version" "ffmpeg version" fi diff --git a/e2e/cli/test_activate_aggressive b/e2e/cli/test_activate_aggressive index ce257410d1..332fe137da 100644 --- a/e2e/cli/test_activate_aggressive +++ b/e2e/cli/test_activate_aggressive @@ -1,6 +1,5 @@ #!/usr/bin/env bash -ORIG_PATH="$PATH" eval "$(mise activate bash)" export PATH="/added:$PATH" diff --git a/e2e/cli/test_settings_ls b/e2e/cli/test_settings_ls index 694cf63c9a..0081018b01 100644 --- a/e2e/cli/test_settings_ls +++ b/e2e/cli/test_settings_ls @@ -1,7 +1,7 @@ #!/usr/bin/env bash echo "settings.all_compile = false" >mise.toml -echo "settings.disable_backends = [\"rust\", \"java\"]" >>mise.toml +echo 'settings.disable_backends = ["rust", "java"]' >>mise.toml assert_contains "mise settings" 'all_compile false ~/workdir/mise.toml disable_backends ["rust", "java"] ~/workdir/mise.toml' diff --git a/e2e/config/test_config_env b/e2e/config/test_config_env index 1e9fdb4776..57b2b11d9e 100644 --- a/e2e/config/test_config_env +++ b/e2e/config/test_config_env @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=SC2209 echo "tools.dummy = '1'" >mise.toml echo "tools.dummy = '2'" >mise.test.toml diff --git a/e2e/core/test_bun b/e2e/core/test_bun index 1de6eaffbb..9b4597ebf6 100644 --- a/e2e/core/test_bun +++ b/e2e/core/test_bun @@ -8,4 +8,4 @@ mise i assert_contains "mise x bun -- bun -v" "1.1.21" require_cmd node -assert_contains "mise x bun -- bunx cowsay \"hello world\"" "hello world" +assert_contains 'mise x bun -- bunx cowsay "hello world"' "hello world" diff --git a/e2e/core/test_deno b/e2e/core/test_deno index 9121ba2f20..218cbaab00 100644 --- a/e2e/core/test_deno +++ b/e2e/core/test_deno @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if [[ "${MISE_DISABLE_TOOLS:-}" = *deno* ]]; then +if [[ ${MISE_DISABLE_TOOLS:-} == *deno* ]]; then warn "Skipping deno tests" exit 0 fi diff --git a/e2e/core/test_java b/e2e/core/test_java index 1cdb73a465..32041e8432 100644 --- a/e2e/core/test_java +++ b/e2e/core/test_java @@ -4,11 +4,11 @@ cat <.sdkmanrc java=17.0.2 EOF mise i java -assert_contains "mise x java -- java -version 2>&1" "openjdk version \"17.0.2\"" +assert_contains "mise x java -- java -version 2>&1" 'openjdk version "17.0.2"' rm .sdkmanrc cat <.java-version 17.0.2 EOF -assert_contains "mise x java -- java -version 2>&1" "openjdk version \"17.0.2\"" +assert_contains "mise x java -- java -version 2>&1" 'openjdk version "17.0.2"' rm .java-version diff --git a/e2e/env/test_env_template b/e2e/env/test_env_template index b38ddad415..b3aa497da0 100644 --- a/e2e/env/test_env_template +++ b/e2e/env/test_env_template @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=SC2016 cat <mise.toml [env] @@ -33,10 +34,10 @@ echo "{% raw %}{{ env.FOO }}{% endraw %}: {{ env.FOO }}" echo "{% raw %}{{ env.BAR }}{% endraw %}: {{ env.BAR }}" """ EOF -assert "mise run --trace foo" "\$FOO: foo -\$BAR: bar +assert "mise run --trace foo" '$FOO: foo +$BAR: bar {{ env.FOO }}: foo -{{ env.BAR }}: bar" +{{ env.BAR }}: bar' cat <mise.toml [env] @@ -48,7 +49,7 @@ env.BAZ = "{{ env.BAR }}" run = "printf '\$BAZ: %s\n' \$BAZ" EOF -assert "mise run --trace foo" "\$BAZ: foo" +assert "mise run --trace foo" '$BAZ: foo' cat <mise.toml [env] diff --git a/e2e/generate/test_generate_devcontainer b/e2e/generate/test_generate_devcontainer index 91337e5e53..69e69e5a38 100755 --- a/e2e/generate/test_generate_devcontainer +++ b/e2e/generate/test_generate_devcontainer @@ -1,55 +1,56 @@ #!/usr/bin/env bash +# shellcheck disable=SC2016 # Default devcontainer -assert_json_partial_object "mise generate devcontainer" "name,description,features,mounts,containerEnv,customizations" " +assert_json_partial_object "mise generate devcontainer" "name,description,features,mounts,containerEnv,customizations" ' { - \"name\": \"mise\", - \"image\": \"mcr.microsoft.com/devcontainers/base:ubuntu\", - \"features\": { - \"ghcr.io/devcontainers-extra/features/mise:1\": {} + "name": "mise", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers-extra/features/mise:1": {} }, - \"customizations\": { - \"vscode\": { - \"extensions\": [ - \"hverlin.mise-vscode\" + "customizations": { + "vscode": { + "extensions": [ + "hverlin.mise-vscode" ] } }, - \"mounts\": [], - \"containerEnv\": {} + "mounts": [], + "containerEnv": {} } -" +' # With custom name and image -assert_json_partial_object "mise generate devcontainer --name test --image testimage:latest" "name,description" " +assert_json_partial_object "mise generate devcontainer --name test --image testimage:latest" "name,description" ' { - \"name\": \"test\", - \"image\": \"testimage:latest\" + "name": "test", + "image": "testimage:latest" } -" +' # With mount -assert_json_partial_object "mise generate devcontainer --mount-mise-data" "name,description,features,mounts,containerEnv,postCreateCommand" " +assert_json_partial_object "mise generate devcontainer --mount-mise-data" "name,description,features,mounts,containerEnv,postCreateCommand" ' { - \"name\": \"mise\", - \"image\": \"mcr.microsoft.com/devcontainers/base:ubuntu\", - \"features\": { - \"ghcr.io/devcontainers-extra/features/mise:1\": {} + "name": "mise", + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "ghcr.io/devcontainers-extra/features/mise:1": {} }, - \"mounts\": [ + "mounts": [ { - \"source\": \"mise-data-volume\", - \"target\": \"/mnt/mise-data\", - \"type\": \"volume\" + "source": "mise-data-volume", + "target": "/mnt/mise-data", + "type": "volume" } ], - \"containerEnv\": { - \"MISE_DATA_DIR\": \"/mnt/mise-data\" + "containerEnv": { + "MISE_DATA_DIR": "/mnt/mise-data" }, - \"remoteEnv\": { - \"PATH\": \"\${containerEnv:PATH}:/mnt/mise-data/shims\" + "remoteEnv": { + "PATH": "${containerEnv:PATH}:/mnt/mise-data/shims" }, - \"postCreateCommand\": \"sudo chown -R vscode:vscode /mnt/mise-data\" + "postCreateCommand": "sudo chown -R vscode:vscode /mnt/mise-data" } -" +' diff --git a/e2e/run_all_tests b/e2e/run_all_tests index 73ffff88d0..eed63b8058 100755 --- a/e2e/run_all_tests +++ b/e2e/run_all_tests @@ -29,14 +29,14 @@ for index in "${!FILES[@]}"; do TEST_NAME="${FILES[$index]}" # split tests into tranches to reduce test time - if [[ -n "${TEST_TRANCHE_COUNT:-}" ]]; then + if [[ -n ${TEST_TRANCHE_COUNT:-} ]]; then if [[ $((index % TEST_TRANCHE_COUNT)) -ne $TEST_TRANCHE ]]; then continue fi fi # Skip slow tests unless TEST_ALL == 1 - if [[ ${TEST_ALL:-0} != 1 && $TEST_NAME = *_slow ]]; then + if [[ ${TEST_ALL:-0} != 1 && $TEST_NAME == *_slow ]]; then # title="E2E test $TEST_NAME skipped" file="e2e/$TEST_NAME" warn "slow tests are disabled" skipped_count=$((skipped_count + 1)) summary "$TEST_NAME" "-" ":zap:" diff --git a/e2e/run_test b/e2e/run_test index 27938b5385..94f5d7ffff 100755 --- a/e2e/run_test +++ b/e2e/run_test @@ -102,7 +102,7 @@ run_test() { echo "$TEST: $DURATION" >&2 - if [[ "$status" == 0 ]]; then + if [[ $status == 0 ]]; then remove_isolated_env summary "$TEST" "$DURATION" ":white_check_mark:" else diff --git a/e2e/shell/zsh_script b/e2e/shell/zsh_script index e838b78330..b12ee6e182 100644 --- a/e2e/shell/zsh_script +++ b/e2e/shell/zsh_script @@ -1,4 +1,5 @@ #!/usr/bin/env zsh +# shellcheck disable=SC1071 set -euo pipefail orig_path="$PATH" @@ -18,7 +19,7 @@ assert_path() { local actual="${PATH/%$orig_path/}" actual="${actual//$HOME/\~}" actual="${actual/%:/}" - if [[ "$actual" != "$expected" ]]; then + if [[ $actual != "$expected" ]]; then echo "Invalid PATH: $actual" echo "Expected PATH: $expected" exit 1 diff --git a/e2e/sync/test_sync_nvm_slow b/e2e/sync/test_sync_nvm_slow index 06ec7c0851..30d73c7c2c 100644 --- a/e2e/sync/test_sync_nvm_slow +++ b/e2e/sync/test_sync_nvm_slow @@ -1,4 +1,5 @@ #!/usr/bin/env bash +# shellcheck disable=SC1091 export NVM_DIR="$PWD/.nvm" mkdir -p "$NVM_DIR" diff --git a/hk.pkl b/hk.pkl index 642411ccdc..1363964ebf 100644 --- a/hk.pkl +++ b/hk.pkl @@ -1,12 +1,32 @@ amends "package://github.com/jdx/hk/releases/download/v1.0.0/hk@1.0.0#/Config.pkl" import "package://github.com/jdx/hk/releases/download/v1.0.0/hk@1.0.0#/Builtins.pkl" +local bash_glob = List("*.sh", "xtasks/**", "scripts/**", "e2e/**") +local bash_exclude = List("*.ps1", "*.fish", "*.ts", "*.js", "*.json", "*.bat", "**/.*", "src/assets/bash_zsh_support/**") local linters = new Mapping { // uses builtin prettier linter config ["prettier"] = Builtins.prettier ["clippy"] = (Builtins.cargo_clippy) { - check = "cargo clippy --manifest-path {{workspace_indicator}} --all-features --allow-dirty --allow-staged" - fix = "cargo clippy --manifest-path {{workspace_indicator}} --all-features --fix --allow-dirty --allow-staged" + check = "cargo clippy --manifest-path {{workspace_indicator}} --all-features" + fix = "cargo clippy --manifest-path {{workspace_indicator}} --all-features --fix --allow-dirty --allow-staged" + } + ["shellcheck"] = (Builtins.shellcheck) { + glob = bash_glob + exclude = bash_exclude + batch = true + check = "shellcheck -x {{ files }}" + } + ["shfmt"] = (Builtins.shfmt) { + check_list_files = """ +files=$(shfmt -l -s {{ files }}) +if [ -n "$files" ]; then + echo "$files" + exit 1 +fi +""" + fix = "shfmt -w -s {{ files }}" + glob = bash_glob + exclude = bash_exclude } // uses custom pkl linter config diff --git a/mise.lock b/mise.lock index 595574a547..05c9c6bbbb 100644 --- a/mise.lock +++ b/mise.lock @@ -8,27 +8,27 @@ backend = "aqua:rhysd/actionlint" "actionlint_1.7.7_linux_arm64.tar.gz" = "sha256:401942f9c24ed71e4fe71b76c7d638f66d8633575c4016efd2977ce7c28317d0" [tools.bun] -version = "1.2.10" +version = "1.2.14" backend = "core:bun" [tools.bun.checksums] -"bun-darwin-aarch64.zip" = "sha256:07895ef0fb661249b86b0b723b65b1cc4790c7f3685b63cda90122b00299972c" -"bun-linux-x64-baseline.zip" = "sha256:4b62f599048ef320a761bacbeeb71f8784f5e373b976a9d53b3ee7811f19b004" +"bun-darwin-aarch64.zip" = "sha256:274c37bad6dd5041f74f65330b0c3980317b1142a1bdece7bebeb3aab44b88da" +"bun-linux-x64-baseline.zip" = "sha256:8590c16b934317401b69eae06109d36c399d64b041386b892f39bf75969abe12" [tools.cargo-binstall] -version = "1.12.3" +version = "1.12.5" backend = "aqua:cargo-bins/cargo-binstall" [tools.cargo-binstall.checksums] -"cargo-binstall-aarch64-apple-darwin.zip" = "sha256:88467030db096ceddf97405750fe9e67cf25106da241db7a60900c58f192206f" -"cargo-binstall-x86_64-unknown-linux-musl.tgz" = "sha256:deeee17791719fc544dd1f542d4a482da70ea4ebfddf414d3ca27e5dc12242e3" +"cargo-binstall-aarch64-apple-darwin.zip" = "sha256:c59a3f059b9b8d7ffaf66c5791a7ae09b9b09f46e2bf68a069a70cfc451ae0ea" +"cargo-binstall-x86_64-unknown-linux-musl.tgz" = "sha256:c6378f62f878e566cbfedc8bb693b143297313b6e2768ac3811ed0a1a51da095" [tools."cargo:cargo-edit"] -version = "0.13.2" +version = "0.13.4" backend = "cargo:cargo-edit" [tools."cargo:cargo-insta"] -version = "1.43.0" +version = "1.43.1" backend = "cargo:cargo-insta" [tools."cargo:git-cliff"] @@ -52,11 +52,11 @@ cosign-darwin-arm64 = "sha256:780da3654d9601367b0d54686ac65cb9716578610cabe292d7 cosign-linux-amd64 = "sha256:1f6c194dd0891eb345b436bb71ff9f996768355f5e0ce02dde88567029ac2188" [tools.hk] -version = "1.1.1" +version = "1.1.2" backend = "aqua:jdx/hk" [tools.hk.checksums] -"hk-aarch64-apple-darwin.tar.gz" = "sha256:0badd05c4b7b0cde50e3da4770f924fe1caa99ab30be7a6c1274b994ae0fcc72" +"hk-x86_64-unknown-linux-gnu.tar.gz" = "sha256:2f889c916a641efb7b5861503bbcaee11752d874e1e4de72bc4727bd571256d5" [tools.jq] version = "1.7.1" @@ -69,7 +69,7 @@ jq-macos-arm64 = "sha256:0bbe619e663e0de2c550be2fe0d240d076799d6f8a652b70fa04aea "jq-windows-amd64.exe" = "sha256:7451fbbf37feffb9bf262bd97c54f0da558c63f0748e64152dd87b0a07b6d6ab" [tools."npm:markdownlint-cli"] -version = "0.44.0" +version = "0.45.0" backend = "npm:markdownlint-cli" [tools."npm:prettier"] @@ -130,16 +130,12 @@ slsa-verifier-linux-x86_64 = "sha256:499befb675efcca9001afe6e5156891b91e71f9c07a slsa-verifier-macos-aarch64 = "sha256:84d9122ce12e0c79080844285fd5c4976407ed3463e434a1b21b0979c46b1e55" [tools.taplo] -version = "0.9.3" +version = "0.10.0" backend = "aqua:tamasfe/taplo" [tools.taplo.checksums] -taplo-full-linux-aarch64 = "sha256:9ffa2a799ff0ca601a0e7ff93dcae64a34c81c677916e6f0d3c81d62e0670d83" -taplo-full-linux-x86_64 = "sha256:e89d2303ea9a5ec07971feec807fa493dc9ab6624c19b313ff90fdede247ee08" -"taplo-full-linux-x86_64.gz" = "sha256:71d655dc3f69ce30454cfade92fdbe846c0ba4aa3afa68f3ff0d216966d0d3c2" -taplo-full-macos-aarch64 = "sha256:cf55aa3e4c9b631c1fbb3f8a4adac59ca2ecc7898d26e749cd9b62d5ed858fce" -"taplo-linux-x86_64.gz" = "sha256:889efcfa067b179fda488427d3b13ce2d679537da8b9ed8138ba415db7da2a5e" -"taplo.exe-full-windows-aarch64" = "sha256:13eaa7f30f321a02a43bcc476450b9a79307f12addc25df132613cbb76d03f86" +"taplo-darwin-aarch64.gz" = "sha256:713734314c3e71894b9e77513c5349835eefbd52908445a0d73b0c7dc469347d" +"taplo-linux-x86_64.gz" = "sha256:8fe196b894ccf9072f98d4e1013a180306e17d244830b03986ee5e8eabeb6156" [tools.wait-for-gh-rate-limit] version = "1.0.0" diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index b98c0b08eb..bcaa7ee945 100755 --- a/scripts/build-deb.sh +++ b/scripts/build-deb.sh @@ -8,29 +8,29 @@ touch mise/lib/.disable-self-update tar -xvJf "dist/mise-$MISE_VERSION-linux-x64.tar.xz" fpm -s dir -t deb \ - --name mise \ - --license MIT \ - --version "${MISE_VERSION#v*}" \ - --architecture amd64 \ - --description "The front-end to your dev env" \ - --url "https://github.com/jdx/mise" \ - --maintainer "Jeff Dickey @jdx" \ - mise/bin/mise=/usr/bin/mise \ - mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ - mise/man/man1/mise.1=/usr/share/man/man1/mise.1 + --name mise \ + --license MIT \ + --version "${MISE_VERSION#v*}" \ + --architecture amd64 \ + --description "The front-end to your dev env" \ + --url "https://github.com/jdx/mise" \ + --maintainer "Jeff Dickey @jdx" \ + mise/bin/mise=/usr/bin/mise \ + mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ + mise/man/man1/mise.1=/usr/share/man/man1/mise.1 tar -xvJf "dist/mise-$MISE_VERSION-linux-arm64.tar.xz" fpm -s dir -t deb \ - --name mise \ - --license MIT \ - --version "${MISE_VERSION#v*}" \ - --architecture arm64 \ - --description "The front-end to your dev env" \ - --url "https://github.com/jdx/mise" \ - --maintainer "Jeff Dickey @jdx" \ - mise/bin/mise=/usr/bin/mise \ - mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ - mise/man/man1/mise.1=/usr/share/man/man1/mise.1 + --name mise \ + --license MIT \ + --version "${MISE_VERSION#v*}" \ + --architecture arm64 \ + --description "The front-end to your dev env" \ + --url "https://github.com/jdx/mise" \ + --maintainer "Jeff Dickey @jdx" \ + mise/bin/mise=/usr/bin/mise \ + mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ + mise/man/man1/mise.1=/usr/share/man/man1/mise.1 mkdir -p dist/deb/pool/main cp -v ./*.deb dist/deb/pool/main diff --git a/scripts/build-rpm.sh b/scripts/build-rpm.sh index 5adb61e990..d47277b0a6 100755 --- a/scripts/build-rpm.sh +++ b/scripts/build-rpm.sh @@ -8,29 +8,29 @@ touch mise/lib/.disable-self-update tar -xvJf "dist/mise-$MISE_VERSION-linux-x64.tar.xz" fpm -s dir -t rpm \ - --name mise \ - --license MIT \ - --version "${MISE_VERSION#v*}" \ - --architecture x86_64 \ - --description "The front-end to your dev env" \ - --url "https://github.com/jdx/mise" \ - --maintainer "Jeff Dickey @jdx" \ - mise/bin/mise=/usr/bin/mise \ - mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ - mise/man/man1/mise.1=/usr/share/man/man1/mise.1 + --name mise \ + --license MIT \ + --version "${MISE_VERSION#v*}" \ + --architecture x86_64 \ + --description "The front-end to your dev env" \ + --url "https://github.com/jdx/mise" \ + --maintainer "Jeff Dickey @jdx" \ + mise/bin/mise=/usr/bin/mise \ + mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ + mise/man/man1/mise.1=/usr/share/man/man1/mise.1 tar -xvJf "dist/mise-$MISE_VERSION-linux-arm64.tar.xz" fpm -s dir -t rpm \ - --name mise \ - --license MIT \ - --version "${MISE_VERSION#v*}" \ - --architecture aarch64 \ - --description "The front-end to your dev env" \ - --url "https://github.com/jdx/mise" \ - --maintainer "Jeff Dickey @jdx" \ - mise/bin/mise=/usr/bin/mise \ - mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ - mise/man/man1/mise.1=/usr/share/man/man1/mise.1 + --name mise \ + --license MIT \ + --version "${MISE_VERSION#v*}" \ + --architecture aarch64 \ + --description "The front-end to your dev env" \ + --url "https://github.com/jdx/mise" \ + --maintainer "Jeff Dickey @jdx" \ + mise/bin/mise=/usr/bin/mise \ + mise/lib/.disable-self-update=/usr/lib/mise/.disable-self-update \ + mise/man/man1/mise.1=/usr/share/man/man1/mise.1 cat <~/.rpmmacros %_signature gpg diff --git a/scripts/build-tarball.sh b/scripts/build-tarball.sh index ce371a9791..569d533c74 100755 --- a/scripts/build-tarball.sh +++ b/scripts/build-tarball.sh @@ -2,57 +2,57 @@ set -euo pipefail error() { - echo "$@" >&2 - exit 1 + echo "$@" >&2 + exit 1 } RUST_TRIPLE=${1:-$(rustc -vV | grep ^host: | cut -d ' ' -f2)} #region os/arch get_os() { - case "$RUST_TRIPLE" in - *-apple-darwin*) - echo "macos" - ;; - *-windows-*) - echo "windows" - ;; - *-linux-*) - echo "linux" - ;; - *) - error "unsupported OS: $RUST_TRIPLE" - ;; - esac + case "$RUST_TRIPLE" in + *-apple-darwin*) + echo "macos" + ;; + *-windows-*) + echo "windows" + ;; + *-linux-*) + echo "linux" + ;; + *) + error "unsupported OS: $RUST_TRIPLE" + ;; + esac } get_arch() { - case "$RUST_TRIPLE" in - aarch64-*) - echo "arm64" - ;; - arm*) - echo "armv7" - ;; - x86_64-*) - echo "x64" - ;; - universal2-*) - echo "universal" - ;; - *) - error "unsupported arch: $RUST_TRIPLE" - ;; - esac + case "$RUST_TRIPLE" in + aarch64-*) + echo "arm64" + ;; + arm*) + echo "armv7" + ;; + x86_64-*) + echo "x64" + ;; + universal2-*) + echo "universal" + ;; + *) + error "unsupported arch: $RUST_TRIPLE" + ;; + esac } get_suffix() { - case "$RUST_TRIPLE" in - *-musl | *-musleabi | *-musleabihf) - echo "-musl" - ;; - *) - echo "" - ;; - esac + case "$RUST_TRIPLE" in + *-musl | *-musleabi | *-musleabihf) + echo "-musl" + ;; + *) + echo "" + ;; + esac } #endregion @@ -64,18 +64,18 @@ version=$(./scripts/get-version.sh) basename=mise-$version-$os-$arch$suffix case "$os-$arch" in - linux-arm*) - # don't use sccache - unset RUSTC_WRAPPER - ;; +linux-arm*) + # don't use sccache + unset RUSTC_WRAPPER + ;; esac if command -v cross >/dev/null; then - cross build --profile=serious --target "$RUST_TRIPLE" --features openssl/vendored + cross build --profile=serious --target "$RUST_TRIPLE" --features openssl/vendored elif command -v zig >/dev/null; then - cargo zigbuild --profile=serious --target "$RUST_TRIPLE" --features openssl/vendored + cargo zigbuild --profile=serious --target "$RUST_TRIPLE" --features openssl/vendored else - cargo build --profile=serious --target "$RUST_TRIPLE" --features openssl/vendored + cargo build --profile=serious --target "$RUST_TRIPLE" --features openssl/vendored fi mkdir -p dist/mise/bin mkdir -p dist/mise/man/man1 @@ -84,23 +84,23 @@ cp "target/$RUST_TRIPLE/serious/mise"* dist/mise/bin cp README.md dist/mise/README.md cp LICENSE dist/mise/LICENSE -if [[ "$os" != "windows" ]]; then - cp {,dist/mise/}man/man1/mise.1 - cp {,dist/mise/}share/fish/vendor_conf.d/mise-activate.fish +if [[ $os != "windows" ]]; then + cp {,dist/mise/}man/man1/mise.1 + cp {,dist/mise/}share/fish/vendor_conf.d/mise-activate.fish fi cd dist -if [[ "$os" == "macos" ]]; then - codesign -f --prefix dev.jdx. -s "Developer ID Application: Jeffrey Dickey (4993Y37DX6)" mise/bin/mise +if [[ $os == "macos" ]]; then + codesign -f --prefix dev.jdx. -s "Developer ID Application: Jeffrey Dickey (4993Y37DX6)" mise/bin/mise fi -if [[ "$os" == "windows" ]]; then - zip -r "$basename.zip" mise - ls -oh "$basename.zip" +if [[ $os == "windows" ]]; then + zip -r "$basename.zip" mise + ls -oh "$basename.zip" else - XZ_OPT=-9 tar -acf "$basename.tar.xz" mise - tar -cf - mise | gzip -9 >"$basename.tar.gz" - ZSTD_NBTHREADS=0 ZSTD_CLEVEL=19 tar -acf "$basename.tar.zst" mise - ls -oh "$basename.tar."* + XZ_OPT=-9 tar -acf "$basename.tar.xz" mise + tar -cf - mise | gzip -9 >"$basename.tar.gz" + ZSTD_NBTHREADS=0 ZSTD_CLEVEL=19 tar -acf "$basename.tar.zst" mise + ls -oh "$basename.tar."* fi diff --git a/scripts/publish-s3.sh b/scripts/publish-s3.sh index b0ae6899d5..55d9c6aeee 100755 --- a/scripts/publish-s3.sh +++ b/scripts/publish-s3.sh @@ -35,12 +35,12 @@ export CLOUDFLARE_ACCOUNT_ID=6e243906ff257b965bcae8025c2fc344 # jdx.dev curl --fail-with-body -X POST "https://api.cloudflare.com/client/v4/zones/90dfd7997bdcfa8579c52d8ee8dd4cd1/purge_cache" \ - -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ - -H "Content-Type: application/json" \ - --data '{ "purge_everything": true }' + -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ + -H "Content-Type: application/json" \ + --data '{ "purge_everything": true }' # mise.run curl --fail-with-body -X POST "https://api.cloudflare.com/client/v4/zones/782fc08181b7bbd26c529a00df52a277/purge_cache" \ - -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ - -H "Content-Type: application/json" \ - --data '{ "purge_everything": true }' + -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \ + -H "Content-Type: application/json" \ + --data '{ "purge_everything": true }' diff --git a/scripts/release-alpine.sh b/scripts/release-alpine.sh index 18762f952f..4821081877 100755 --- a/scripts/release-alpine.sh +++ b/scripts/release-alpine.sh @@ -33,19 +33,19 @@ abuild -r git add APKBUILD if git diff --cached --exit-code; then - echo "No changes to commit" - exit 0 + echo "No changes to commit" + exit 0 fi git commit -m "community/mise: upgrade to ${MISE_VERSION#v}" if [ "$DRY_RUN" == 0 ]; then - git push jdxcode -f + git push jdxcode -f fi open_mr="$(glab mr list -R alpine/aports --author=@me)" -if [[ "$open_mr" != "Showing"* ]]; then - if [ "$DRY_RUN" == 0 ]; then - DEBUG=1 glab mr create --fill --yes -H jdxcode/aports -R alpine/aports - fi +if [[ $open_mr != "Showing"* ]]; then + if [ "$DRY_RUN" == 0 ]; then + DEBUG=1 glab mr create --fill --yes -H jdxcode/aports -R alpine/aports + fi fi #git show diff --git a/scripts/release-npm.sh b/scripts/release-npm.sh index f616130db6..1fbcf29fd6 100755 --- a/scripts/release-npm.sh +++ b/scripts/release-npm.sh @@ -2,50 +2,50 @@ set -euxo pipefail error() { - echo "$@" >&2 - exit 1 + echo "$@" >&2 + exit 1 } -if [[ -z "${NODE_AUTH_TOKEN:-}" ]]; then - echo "NODE_AUTH_TOKEN must be set" >&2 - exit 0 +if [[ -z ${NODE_AUTH_TOKEN:-} ]]; then + echo "NODE_AUTH_TOKEN must be set" >&2 + exit 0 fi mkdir -p "$RELEASE_DIR/npm" dist_tag_from_version() { - IFS="-" read -r -a version_split <<<"$1" - IFS="." read -r -a version_split <<<"${version_split[1]:-latest}" - echo "${version_split[0]}" + IFS="-" read -r -a version_split <<<"$1" + IFS="." read -r -a version_split <<<"${version_split[1]:-latest}" + echo "${version_split[0]}" } dist_tag="$(dist_tag_from_version "$MISE_VERSION")" platforms=( - linux-x64 - linux-x64-musl - linux-arm64 - linux-arm64-musl - linux-armv7 - linux-armv7-musl - macos-x64 - macos-arm64 + linux-x64 + linux-x64-musl + linux-arm64 + linux-arm64-musl + linux-armv7 + linux-armv7-musl + macos-x64 + macos-arm64 ) for platform in "${platforms[@]}"; do - # shellcheck disable=SC2206 - platform_split=(${platform//-/ }) - os="${platform_split[0]}" - arch="${platform_split[1]}" - - if [[ "$os" == "macos" ]]; then - os="darwin" - fi - - cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" "$RELEASE_DIR/mise-latest-$platform.tar.gz" - cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.xz" "$RELEASE_DIR/mise-latest-$platform.tar.xz" - tar -xzvf "$RELEASE_DIR/mise-latest-$platform.tar.gz" -C "$RELEASE_DIR" - rm -rf "$RELEASE_DIR/npm" - mv "$RELEASE_DIR/mise" "$RELEASE_DIR/npm" - cat <"$RELEASE_DIR/npm/package.json" + # shellcheck disable=SC2206 + platform_split=(${platform//-/ }) + os="${platform_split[0]}" + arch="${platform_split[1]}" + + if [[ $os == "macos" ]]; then + os="darwin" + fi + + cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" "$RELEASE_DIR/mise-latest-$platform.tar.gz" + cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.xz" "$RELEASE_DIR/mise-latest-$platform.tar.xz" + tar -xzvf "$RELEASE_DIR/mise-latest-$platform.tar.gz" -C "$RELEASE_DIR" + rm -rf "$RELEASE_DIR/npm" + mv "$RELEASE_DIR/mise" "$RELEASE_DIR/npm" + cat <"$RELEASE_DIR/npm/package.json" { "name": "$NPM_PREFIX-$os-$arch", "version": "$MISE_VERSION", @@ -66,16 +66,16 @@ for platform in "${platforms[@]}"; do "cpu": "$arch" } EOF - pushd "$RELEASE_DIR/npm" - tree || true - if [ "$DRY_RUN" != "0" ]; then - echo DRY_RUN - echo npm publish --access public --tag "$dist_tag" - echo DRY_RUN - else - npm publish --access public --tag "$dist_tag" || true - fi - popd + pushd "$RELEASE_DIR/npm" + tree || true + if [ "$DRY_RUN" != "0" ]; then + echo DRY_RUN + echo npm publish --access public --tag "$dist_tag" + echo DRY_RUN + else + npm publish --access public --tag "$dist_tag" || true + fi + popd done cat <"$RELEASE_DIR/npm/installArchSpecificPackage.js" @@ -166,10 +166,10 @@ cat <"$RELEASE_DIR/npm/package.json" EOF pushd "$RELEASE_DIR/npm" if [ "$DRY_RUN" != "0" ]; then - echo DRY_RUN - echo npm publish --access public --tag "$dist_tag" - echo DRY_RUN + echo DRY_RUN + echo npm publish --access public --tag "$dist_tag" + echo DRY_RUN else - npm publish --access public --tag "$dist_tag" || true + npm publish --access public --tag "$dist_tag" || true fi popd diff --git a/scripts/release.sh b/scripts/release.sh index c4c2ec2d32..67395393ea 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -14,38 +14,38 @@ mkdir -p "$RELEASE_DIR/$MISE_VERSION" echo "::group::Build" platforms=( - linux-x64 - linux-x64-musl - linux-arm64 - linux-arm64-musl - linux-armv7 - linux-armv7-musl - macos-x64 - macos-arm64 + linux-x64 + linux-x64-musl + linux-arm64 + linux-arm64-musl + linux-armv7 + linux-armv7-musl + macos-x64 + macos-arm64 ) for platform in "${platforms[@]}"; do - cp artifacts/*/"mise-$MISE_VERSION-$platform.tar.gz" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" - cp artifacts/*/"mise-$MISE_VERSION-$platform.tar.xz" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.xz" - cp artifacts/*/"mise-$MISE_VERSION-$platform.tar.zst" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.zst" - zipsign sign tar "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" ~/.zipsign/mise.priv - zipsign verify tar "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" "$BASE_DIR/zipsign.pub" - cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" "$RELEASE_DIR/mise-latest-$platform.tar.gz" - cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.xz" "$RELEASE_DIR/mise-latest-$platform.tar.xz" - cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.zst" "$RELEASE_DIR/mise-latest-$platform.tar.zst" - tar -xvzf "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" - cp -v mise/bin/mise "$RELEASE_DIR/mise-latest-$platform" - cp -v mise/bin/mise "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform" + cp artifacts/*/"mise-$MISE_VERSION-$platform.tar.gz" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" + cp artifacts/*/"mise-$MISE_VERSION-$platform.tar.xz" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.xz" + cp artifacts/*/"mise-$MISE_VERSION-$platform.tar.zst" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.zst" + zipsign sign tar "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" ~/.zipsign/mise.priv + zipsign verify tar "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" "$BASE_DIR/zipsign.pub" + cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" "$RELEASE_DIR/mise-latest-$platform.tar.gz" + cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.xz" "$RELEASE_DIR/mise-latest-$platform.tar.xz" + cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.zst" "$RELEASE_DIR/mise-latest-$platform.tar.zst" + tar -xvzf "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.tar.gz" + cp -v mise/bin/mise "$RELEASE_DIR/mise-latest-$platform" + cp -v mise/bin/mise "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform" done windows_platforms=( - windows-arm64 - windows-x64 + windows-arm64 + windows-x64 ) for platform in "${windows_platforms[@]}"; do - cp artifacts/*/"mise-$MISE_VERSION-$platform.zip" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" - zipsign sign zip "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" ~/.zipsign/mise.priv - zipsign verify zip "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" "$BASE_DIR/zipsign.pub" - cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" "$RELEASE_DIR/mise-latest-$platform.zip" + cp artifacts/*/"mise-$MISE_VERSION-$platform.zip" "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" + zipsign sign zip "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" ~/.zipsign/mise.priv + zipsign verify zip "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" "$BASE_DIR/zipsign.pub" + cp "$RELEASE_DIR/$MISE_VERSION/mise-$MISE_VERSION-$platform.zip" "$RELEASE_DIR/mise-latest-$platform.zip" done echo "::group::Checksums" @@ -82,13 +82,13 @@ curl -L -o "$TMP_FILE" "https://github.com/jdx/mise/archive/refs/tags/$MISE_VERS gpg --detach-sign -u 8B81C9D17413A06D <"$TMP_FILE" >"$RELEASE_DIR/$MISE_VERSION/$MISE_VERSION.tar.gz.sig" rm "$TMP_FILE" -if [[ "$DRY_RUN" != 1 ]]; then - echo "::group::Publish npm @jdxcode/mise" - NPM_PREFIX=@jdxcode/mise ./scripts/release-npm.sh - # echo "::group::Publish npm mise-cli" - # NPM_PREFIX=mise-cli ./scripts/release-npm.sh - echo "::group::Publish r2" - ./scripts/publish-r2.sh - echo "::group::Publish GitHub releases" - gh release edit --draft=false "$MISE_VERSION" +if [[ $DRY_RUN != 1 ]]; then + echo "::group::Publish npm @jdxcode/mise" + NPM_PREFIX=@jdxcode/mise ./scripts/release-npm.sh + # echo "::group::Publish npm mise-cli" + # NPM_PREFIX=mise-cli ./scripts/release-npm.sh + echo "::group::Publish r2" + ./scripts/publish-r2.sh + echo "::group::Publish GitHub releases" + gh release edit --draft=false "$MISE_VERSION" fi diff --git a/scripts/render-install.sh b/scripts/render-install.sh index f9369e8838..7912171b71 100755 --- a/scripts/render-install.sh +++ b/scripts/render-install.sh @@ -3,21 +3,21 @@ set -euxo pipefail # shellcheck disable=SC2016 MISE_CURRENT_VERSION=$MISE_VERSION \ - MISE_CHECKSUM_LINUX_X86_64=$(grep "mise-v.*linux-x64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_X86_64_MUSL=$(grep "mise-v.*linux-x64-musl.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARM64=$(grep "mise-v.*linux-arm64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARM64_MUSL=$(grep "mise-v.*linux-arm64-musl.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARMV7=$(grep "mise-v.*linux-armv7.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARMV7_MUSL=$(grep "mise-v.*linux-armv7-musl.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_MACOS_X86_64=$(grep "mise-v.*macos-x64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_MACOS_ARM64=$(grep "mise-v.*macos-arm64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_X86_64_ZSTD=$(grep "mise-v.*linux-x64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_X86_64_MUSL_ZSTD=$(grep "mise-v.*linux-x64-musl.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARM64_ZSTD=$(grep "mise-v.*linux-arm64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARM64_MUSL_ZSTD=$(grep "mise-v.*linux-arm64-musl.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARMV7_ZSTD=$(grep "mise-v.*linux-armv7.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_LINUX_ARMV7_MUSL_ZSTD=$(grep "mise-v.*linux-armv7-musl.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_MACOS_X86_64_ZSTD=$(grep "mise-v.*macos-x64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - MISE_CHECKSUM_MACOS_ARM64_ZSTD=$(grep "mise-v.*macos-arm64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ - envsubst '$MISE_CURRENT_VERSION,$MISE_CHECKSUM_LINUX_X86_64,$MISE_CHECKSUM_LINUX_X86_64_MUSL,$MISE_CHECKSUM_LINUX_ARM64,$MISE_CHECKSUM_LINUX_ARM64_MUSL,$MISE_CHECKSUM_LINUX_ARMV6,$MISE_CHECKSUM_LINUX_ARMV6_MUSL,$MISE_CHECKSUM_LINUX_ARMV7,$MISE_CHECKSUM_LINUX_ARMV7_MUSL,$MISE_CHECKSUM_MACOS_X86_64,$MISE_CHECKSUM_MACOS_ARM64,$MISE_CHECKSUM_LINUX_X86_64_ZSTD,$MISE_CHECKSUM_LINUX_X86_64_MUSL_ZSTD,$MISE_CHECKSUM_LINUX_ARM64_ZSTD,$MISE_CHECKSUM_LINUX_ARM64_MUSL_ZSTD,$MISE_CHECKSUM_LINUX_ARMV7_ZSTD,$MISE_CHECKSUM_LINUX_ARMV7_MUSL_ZSTD,$MISE_CHECKSUM_MACOS_X86_64_ZSTD,$MISE_CHECKSUM_MACOS_ARM64_ZSTD' \ - <"$BASE_DIR/packaging/standalone/install.envsubst" + MISE_CHECKSUM_LINUX_X86_64=$(grep "mise-v.*linux-x64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_X86_64_MUSL=$(grep "mise-v.*linux-x64-musl.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARM64=$(grep "mise-v.*linux-arm64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARM64_MUSL=$(grep "mise-v.*linux-arm64-musl.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARMV7=$(grep "mise-v.*linux-armv7.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARMV7_MUSL=$(grep "mise-v.*linux-armv7-musl.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_MACOS_X86_64=$(grep "mise-v.*macos-x64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_MACOS_ARM64=$(grep "mise-v.*macos-arm64.tar.gz" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_X86_64_ZSTD=$(grep "mise-v.*linux-x64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_X86_64_MUSL_ZSTD=$(grep "mise-v.*linux-x64-musl.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARM64_ZSTD=$(grep "mise-v.*linux-arm64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARM64_MUSL_ZSTD=$(grep "mise-v.*linux-arm64-musl.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARMV7_ZSTD=$(grep "mise-v.*linux-armv7.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_LINUX_ARMV7_MUSL_ZSTD=$(grep "mise-v.*linux-armv7-musl.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_MACOS_X86_64_ZSTD=$(grep "mise-v.*macos-x64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + MISE_CHECKSUM_MACOS_ARM64_ZSTD=$(grep "mise-v.*macos-arm64.tar.zst" "$RELEASE_DIR/$MISE_VERSION/SHASUMS256.txt") \ + envsubst '$MISE_CURRENT_VERSION,$MISE_CHECKSUM_LINUX_X86_64,$MISE_CHECKSUM_LINUX_X86_64_MUSL,$MISE_CHECKSUM_LINUX_ARM64,$MISE_CHECKSUM_LINUX_ARM64_MUSL,$MISE_CHECKSUM_LINUX_ARMV6,$MISE_CHECKSUM_LINUX_ARMV6_MUSL,$MISE_CHECKSUM_LINUX_ARMV7,$MISE_CHECKSUM_LINUX_ARMV7_MUSL,$MISE_CHECKSUM_MACOS_X86_64,$MISE_CHECKSUM_MACOS_ARM64,$MISE_CHECKSUM_LINUX_X86_64_ZSTD,$MISE_CHECKSUM_LINUX_X86_64_MUSL_ZSTD,$MISE_CHECKSUM_LINUX_ARM64_ZSTD,$MISE_CHECKSUM_LINUX_ARM64_MUSL_ZSTD,$MISE_CHECKSUM_LINUX_ARMV7_ZSTD,$MISE_CHECKSUM_LINUX_ARMV7_MUSL_ZSTD,$MISE_CHECKSUM_MACOS_X86_64_ZSTD,$MISE_CHECKSUM_MACOS_ARM64_ZSTD' \ + <"$BASE_DIR/packaging/standalone/install.envsubst" diff --git a/scripts/setup-zipsign.sh b/scripts/setup-zipsign.sh index a8464fdaeb..ce6935c174 100755 --- a/scripts/setup-zipsign.sh +++ b/scripts/setup-zipsign.sh @@ -2,12 +2,12 @@ set -euxo pipefail if [ -z "$ZIPSIGN" ]; then - echo "ZIPSIGN is not defined" - exit 0 + echo "ZIPSIGN is not defined" + exit 0 fi if ! command -v zipsign >/dev/null 2>&1; then - cargo install zipsign + cargo install zipsign fi mkdir -p ~/.zipsign diff --git a/scripts/test-standalone.sh b/scripts/test-standalone.sh index 6d3b58e4d2..d745445f6b 100755 --- a/scripts/test-standalone.sh +++ b/scripts/test-standalone.sh @@ -14,7 +14,7 @@ mise x shellcheck -- shellcheck tmp/install.sh ./tmp/install.sh if [[ ! "$("$HOME/.local/bin/mise" -v)" =~ ^${MISE_VERSION//v/} ]]; then - echo "mise version mismatch" - exit 1 + echo "mise version mismatch" + exit 1 fi rm -rf "$RELEASE_DIR" diff --git a/tasks.md b/tasks.md index 2341aa03a0..00feea541e 100644 --- a/tasks.md +++ b/tasks.md @@ -117,6 +117,10 @@ User to run as - **Usage**: `lint:clippy` +## `lint:hk` + +- **Usage**: `lint:hk` + ## `lint:markdownlint` - **Usage**: `lint:markdownlint` @@ -129,14 +133,6 @@ User to run as - **Usage**: `lint:ripgrep` -## `lint:shellcheck` - -- **Usage**: `lint:shellcheck` - -## `lint:shfmt` - -- **Usage**: `lint:shfmt` - ## `lint:toml` - **Usage**: `lint:toml` diff --git a/xtasks/.hidden/bar/baz/hidden-executable b/xtasks/.hidden/bar/baz/hidden-executable index 532c5a065c..931261d8db 100644 --- a/xtasks/.hidden/bar/baz/hidden-executable +++ b/xtasks/.hidden/bar/baz/hidden-executable @@ -1,15 +1,8 @@ #!/usr/bin/env bash set -euxo pipefail -# Used for shellcheck which needs explicit args -scripts=("$PWD"/scripts/*.sh "$PWD"/e2e/{test_,run_}* "$PWD"/e2e/*.sh) -# Used for shfmt which will run only on files it can -scripts_dirs=("$PWD"/scripts "$PWD"/e2e) - cargo clippy -- -Dwarnings cargo fmt --all -- --check -shellcheck -x "${scripts[@]}" -shfmt -d -i 2 -ci -bn "${scripts_dirs[@]}" prettier -c $(git ls-files '*.yml' '*.yaml') markdownlint . actionlint diff --git a/xtasks/docs/release b/xtasks/docs/release index 60fcbe2d44..6432f1479e 100755 --- a/xtasks/docs/release +++ b/xtasks/docs/release @@ -8,17 +8,17 @@ export AWS_REGION=auto export AWS_ENDPOINT_URL=https://6e243906ff257b965bcae8025c2fc344.r2.cloudflarestorage.com if [ "${DRY_RUN:-true}" = "true" ]; then - aws() { - echo "DRY RUN: aws $*" - } + aws() { + echo "DRY RUN: aws $*" + } fi if [ $((RANDOM % 30)) -eq 0 ]; then - # delete old assets only roughly 1/30 times - # deleting old assets can break the site for people currently on it - # but it's also good to keep things tidy - aws s3 rm --recursive s3://mise/assets/ - aws s3 rm --recursive --exclude "*" --include "*.html" s3://mise/ + # delete old assets only roughly 1/30 times + # deleting old assets can break the site for people currently on it + # but it's also good to keep things tidy + aws s3 rm --recursive s3://mise/assets/ + aws s3 rm --recursive --exclude "*" --include "*.html" s3://mise/ fi aws s3 cp --recursive --checksum-algorithm CRC32 .vitepress/dist s3://mise/ diff --git a/xtasks/fetch-gpg-keys b/xtasks/fetch-gpg-keys index 0b7a4d5358..e25ec3f821 100755 --- a/xtasks/fetch-gpg-keys +++ b/xtasks/fetch-gpg-keys @@ -1,22 +1,23 @@ #!/usr/bin/env bash +# shellcheck disable=SC2129 set -euxo pipefail NODE_FINGERPRINTS=( - "C0D6248439F1D5604AAFFB4021D900FFDB233756" # Antoine du Hamel - "DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7" # Juan José Arboleda - "CC68F5A3106FF448322E48ED27F5E38D5B0A215F" # Marco Ippolito - "8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600" # Michaël Zasso - "890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4" # Rafael Gonzaga - "C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C" # Richard Lau - "108F52B48DB57BB0CC439B2997B01419BD92F80A" # Ruy Adorno - "A363A499291CBBC940DD62E41F10027AF002F8B0" # Ulises Gascón + "C0D6248439F1D5604AAFFB4021D900FFDB233756" # Antoine du Hamel + "DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7" # Juan José Arboleda + "CC68F5A3106FF448322E48ED27F5E38D5B0A215F" # Marco Ippolito + "8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600" # Michaël Zasso + "890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4" # Rafael Gonzaga + "C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C" # Richard Lau + "108F52B48DB57BB0CC439B2997B01419BD92F80A" # Ruy Adorno + "A363A499291CBBC940DD62E41F10027AF002F8B0" # Ulises Gascón ) rm -rf src/assets/gpg mkdir -p src/assets/gpg for fingerprint in "${NODE_FINGERPRINTS[@]}"; do - curl -fLSs "https://keys.openpgp.org/vks/v1/by-fingerprint/$fingerprint" >> "src/assets/gpg/node.asc" + curl -fLSs "https://keys.openpgp.org/vks/v1/by-fingerprint/$fingerprint" >>"src/assets/gpg/node.asc" done -curl -fLSs "https://swift.org/keys/automatic-signing-key-4.asc" >> src/assets/gpg/swift.asc -curl -fLSs "https://swift.org/keys/release-key-swift-5.x.asc" >> src/assets/gpg/swift.asc -curl -fLSs "https://swift.org/keys/release-key-swift-6.x.asc" >> src/assets/gpg/swift.asc +curl -fLSs "https://swift.org/keys/automatic-signing-key-4.asc" >>src/assets/gpg/swift.asc +curl -fLSs "https://swift.org/keys/release-key-swift-5.x.asc" >>src/assets/gpg/swift.asc +curl -fLSs "https://swift.org/keys/release-key-swift-6.x.asc" >>src/assets/gpg/swift.asc diff --git a/xtasks/lint-fix.sh b/xtasks/lint-fix.sh index 7f74065a9a..d1b1f7ee9b 100755 --- a/xtasks/lint-fix.sh +++ b/xtasks/lint-fix.sh @@ -3,15 +3,6 @@ #MISE wait_for=["render:settings"] set -euxo pipefail -# Used for shellcheck which needs explicit args -scripts=("$PWD"/scripts/*.sh "$PWD"/e2e/{test_,run_}* "$PWD"/e2e/*.sh) -# Used for shfmt which will run only on files it can -scripts_dirs=("$PWD"/scripts "$PWD"/e2e) -shellcheck -x "${scripts[@]}" -shfmt -w -i 2 -ci -bn "${scripts_dirs[@]}" -# shellcheck disable=SC2046 -prettier -w $(git ls-files '*.yml' '*.yaml') -prettier -w . markdownlint --fix . taplo fmt SHELLCHECK_OPTS="--exclude=SC1090 --exclude=SC2046" actionlint diff --git a/xtasks/lint/clippy b/xtasks/lint/clippy index b1261ad965..4b001f6b4f 100755 --- a/xtasks/lint/clippy +++ b/xtasks/lint/clippy @@ -2,8 +2,8 @@ #MISE wait_for=["build"] set -euo pipefail -if [[ "${MISE_PRE_COMMIT:-}" == 1 ]]; then - cargo check -q --all-features +if [[ ${MISE_PRE_COMMIT:-} == 1 ]]; then + cargo check -q --all-features else - cargo clippy --all-features -- -Dwarnings + cargo clippy --all-features -- -Dwarnings fi diff --git a/xtasks/lint/hk b/xtasks/lint/hk new file mode 100755 index 0000000000..200d49c80a --- /dev/null +++ b/xtasks/lint/hk @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +#MISE wait_for=["build"] +HK_FAIL_FAST=0 exec hk check --all diff --git a/xtasks/lint/shellcheck b/xtasks/lint/shellcheck deleted file mode 100755 index 1e4922c199..0000000000 --- a/xtasks/lint/shellcheck +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -shellcheck -x "$PWD"{/scripts,/e2e}/*.sh "$PWD"/e2e/{test_,run_}* diff --git a/xtasks/lint/shfmt b/xtasks/lint/shfmt deleted file mode 100755 index 5b9b45b72d..0000000000 --- a/xtasks/lint/shfmt +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -shfmt -d -i 2 -ci -bn "$PWD"/{e2e,scripts} diff --git a/xtasks/release-plz b/xtasks/release-plz index 0edad4d6f3..043732ac7d 100755 --- a/xtasks/release-plz +++ b/xtasks/release-plz @@ -6,14 +6,14 @@ git config user.email release@mise.jdx.dev cur_version="$(cargo pkgid mise | cut -d# -f2)" if ! curl https://crates.io/api/v1/crates/mise | jq -r '.versions[0].num' | grep -q "$cur_version"; then - echo "Releasing $cur_version" - cargo publish - changelog="$(git cliff --tag "v$cur_version" --strip all --unreleased)" - changelog="$(echo "$changelog" | tail -n +3)" - git tag "v$cur_version" -s -m "$changelog" - git push --tags - gh release create "v$cur_version" --title "v$cur_version" --notes "$changelog" --draft - exit 0 + echo "Releasing $cur_version" + cargo publish + changelog="$(git cliff --tag "v$cur_version" --strip all --unreleased)" + changelog="$(echo "$changelog" | tail -n +3)" + git tag "v$cur_version" -s -m "$changelog" + git push --tags + gh release create "v$cur_version" --title "v$cur_version" --notes "$changelog" --draft + exit 0 fi git submodule update --remote @@ -21,11 +21,11 @@ git submodule update --remote year="$(date +%Y)" month="$(date +%-m)" if echo "$cur_version" | grep -e "^$year\.$month\."; then - cargo set-version --bump patch + cargo set-version --bump patch elif echo "$cur_version" | grep -e "^$year\."; then - cargo set-version --bump minor + cargo set-version --bump minor else - cargo set-version "$year.1.0" + cargo set-version "$year.1.0" fi version="$(cargo pkgid mise | cut -d# -f2)" @@ -41,23 +41,23 @@ mise run render ::: lint-fix mise up #cargo update git add \ - Cargo.lock \ - Cargo.toml \ - CHANGELOG.md \ - README.md \ - aqua-registry \ - default.nix \ - packaging/rpm/mise.spec \ - mise.usage.kdl \ - completions \ - man/ + Cargo.lock \ + Cargo.toml \ + CHANGELOG.md \ + README.md \ + aqua-registry \ + default.nix \ + packaging/rpm/mise.spec \ + mise.usage.kdl \ + completions \ + man/ git clean -df git checkout -B release git commit -m "chore: release $version" git push origin release --force if [[ "$(gh pr list --label release)" == "" ]]; then - gh pr create --title "chore: release $version" --body "$changelog" --label "release" --head release + gh pr create --title "chore: release $version" --body "$changelog" --label "release" --head release else - gh pr edit --title "chore: release $version" --body "$changelog" + gh pr edit --title "chore: release $version" --body "$changelog" fi diff --git a/xtasks/show-output-on-failure b/xtasks/show-output-on-failure index a2a858d323..e09594a296 100755 --- a/xtasks/show-output-on-failure +++ b/xtasks/show-output-on-failure @@ -4,7 +4,7 @@ set -euo pipefail output=$("$@" 2>&1) status=$? if ((status)); then - echo "$output" >&2 + echo "$output" >&2 fi exit $status diff --git a/xtasks/test/coverage b/xtasks/test/coverage index 8701e823b7..dfd249140c 100755 --- a/xtasks/test/coverage +++ b/xtasks/test/coverage @@ -5,7 +5,7 @@ echo "::group::Setup" set -euxo pipefail # shellcheck disable=SC1090 if [[ -n ${MISE_GITHUB_BOT_TOKEN:-} ]]; then - export GITHUB_API_TOKEN="$MISE_GITHUB_BOT_TOKEN" + export GITHUB_API_TOKEN="$MISE_GITHUB_BOT_TOKEN" fi export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$PWD/target}" export PATH="${CARGO_TARGET_DIR}/debug:$PATH" diff --git a/xtasks/test/e2e b/xtasks/test/e2e index e7b4665f40..23225c8624 100755 --- a/xtasks/test/e2e +++ b/xtasks/test/e2e @@ -6,17 +6,17 @@ set -euo pipefail export RUST_TEST_THREADS=1 -if [[ "${1:-all}" == all ]]; then - ./e2e/run_all_tests +if [[ ${1:-all} == all ]]; then + ./e2e/run_all_tests else - pushd e2e - FILES="$(fd -tf "$1" --and "^test_")" - popd - if [[ -z $FILES ]]; then - echo "Not test matches $1" >&2 - exit 1 - fi - for FILE in $FILES; do - ./e2e/run_test "$FILE" - done + pushd e2e + FILES="$(fd -tf "$1" --and "^test_")" + popd + if [[ -z $FILES ]]; then + echo "Not test matches $1" >&2 + exit 1 + fi + for FILE in $FILES; do + ./e2e/run_test "$FILE" + done fi diff --git a/xtasks/update-descriptions b/xtasks/update-descriptions index 12aa0ed5c9..9b2d0e7d15 100755 --- a/xtasks/update-descriptions +++ b/xtasks/update-descriptions @@ -2,9 +2,9 @@ set -euxo pipefail for tool in $(mise registry | awk '{print $1}'); do - description="$(mise tool --description "$tool")" - if [ "$description" != "[none]" ]; then - toml set registry.toml "tools.$tool.description" "$description" > registry.toml.tmp - mv registry.toml.tmp registry.toml - fi + description="$(mise tool --description "$tool")" + if [ "$description" != "[none]" ]; then + toml set registry.toml "tools.$tool.description" "$description" >registry.toml.tmp + mv registry.toml.tmp registry.toml + fi done