From 2e9a9617010fbb8ea6b05858cb48363e905a3e8a Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdx@users.noreply.github.com> Date: Sat, 16 Mar 2024 15:34:49 -0500 Subject: [PATCH] chore: cargo update --- .github/workflows/release-plz.yml | 46 +++++++ .mise/tasks/release-plz | 31 +++++ .../tasks/update-shorthand-repo | 2 +- Cargo.toml | 39 +++--- README.md | 6 +- cliff.toml | 90 ++++++++++++++ e2e/assert.sh | 56 ++++----- scripts/build-deb.sh | 40 +++--- scripts/build-rpm.sh | 40 +++--- scripts/build-tarball.sh | 114 +++++++++--------- scripts/pre-release-hook.sh | 13 -- scripts/publish-s3.sh | 18 +-- scripts/release-alpine.sh | 12 +- scripts/release-aur-bin.sh | 8 +- scripts/release-aur.sh | 8 +- scripts/release-npm.sh | 92 +++++++------- scripts/release.sh | 48 ++++---- scripts/render-homebrew.sh | 24 ++-- scripts/render-install.sh | 24 ++-- scripts/setup-zipsign.sh | 6 +- scripts/test-standalone.sh | 4 +- src/default_shorthands.rs | 4 +- test/fixtures/signal-test.js | 16 +-- 23 files changed, 442 insertions(+), 299 deletions(-) create mode 100644 .github/workflows/release-plz.yml create mode 100755 .mise/tasks/release-plz rename scripts/update-shorthand-repo.sh => .mise/tasks/update-shorthand-repo (97%) create mode 100644 cliff.toml delete mode 100755 scripts/pre-release-hook.sh diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 000000000..5a45eca0f --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,46 @@ +name: release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + - release-plz + +concurrency: + group: release-plz + +jobs: + release-plz: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + - uses: Swatinem/rust-cache@v2 + with: + shared-key: unit + #save-if: false TODO: add this back later + cache-on-failure: true + - run: mkdir -p $HOME/bin && echo "$HOME/bin" >> "$GITHUB_PATH" + - run: | + set -euxo pipefail + cargo build --all-features + cp target/debug/mise $HOME/bin + mise trust --all + mise settings set experimental true + - uses: actions/cache@v4 + with: + path: ~/.local/share/mise/{installs,plugins} + key: v0-mise-tools-${{ runner.os }}-${{ hashFiles('.mise.toml') }} + restore-keys: v0-mise-tools-${{ runner.os }}- + save-always: true + - run: mise install + - run: mise run release-plz + env: + GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.mise/tasks/release-plz b/.mise/tasks/release-plz new file mode 100755 index 000000000..a92810ff1 --- /dev/null +++ b/.mise/tasks/release-plz @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euxo pipefail + +version="$(git cliff --bumped-version)" +changelog="$(git cliff --unreleased)" + +sed -i.bak "s/^mise [0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?$/mise $version/" README.md +sed -i.bak "s/^Version: [0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?$/Version: $version/" packaging/rpm/mise.spec +sed -i.bak "s/version = \"[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\";$/version = \"$version\";/" default.nix + +mise run update-shorthand-repo +mise run render ::: lint-fix + +git config user.name mise-en-dev +git config user.email 123107610+mise-en-dev@users.noreply.github.com +git cliff --bump -o CHANGELOG.md --verbose +git add \ + CHANGELOG.md \ + README.md \ + default.nix \ + packaging/rpm/mise.spec \ + src/default_shorthands.rs \ + mise.usage.kdl \ + completions \ + man/ +git clean -df +git checkout -B release +git commit -m "Release $version" +git push origin release --force +gh pr create --title "Release $version" --body "$changelog" --label "release" || + gh pr edit --title "Release $version" --body "$changelog" diff --git a/scripts/update-shorthand-repo.sh b/.mise/tasks/update-shorthand-repo similarity index 97% rename from scripts/update-shorthand-repo.sh rename to .mise/tasks/update-shorthand-repo index cbd19a796..e5145221c 100755 --- a/scripts/update-shorthand-repo.sh +++ b/.mise/tasks/update-shorthand-repo @@ -17,7 +17,7 @@ cat >src/default_shorthands.rs < +""" +# remove the leading and trailing s +trim = true +# postprocessors +postprocessors = [ + # { pattern = '', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL +] + +[git] +# parse the commits based on https://www.conventionalcommits.org +conventional_commits = true +# filter out the commits that are not conventional +filter_unconventional = true +# process each line of a commit as an individual commit +split_commits = false +# regex for preprocessing the commit messages +commit_preprocessors = [ + # Replace issue numbers + #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, + # Check spelling of the commit with https://github.com/crate-ci/typos + # If the spelling is incorrect, it will be automatically fixed. + #{ pattern = '.*', replace_command = 'typos --write-changes -' }, +] +# regex for parsing and grouping commits +commit_parsers = [ + { message = "^feat", group = "๐Ÿš€ Features" }, + { message = "^fix\\(deps\\)", skip = true }, + { message = "^fix", group = "๐Ÿ› Bug Fixes" }, + { message = "^doc", group = "๐Ÿ“š Documentation" }, + { message = "^perf", group = "โšก Performance" }, + { message = "^refactor", group = "๐Ÿšœ Refactor" }, + { message = "^style", group = "๐ŸŽจ Styling" }, + { message = "^test", group = "๐Ÿงช Testing" }, + { message = "^chore\\(release\\): prepare for", skip = true }, + { message = "^chore\\(deps.*\\)", skip = true }, + { message = "^chore\\(pr\\)", skip = true }, + { message = "^chore\\(pull\\)", skip = true }, + { message = "^chore|^ci", group = "โš™๏ธ Miscellaneous Tasks" }, + { body = ".*security", group = "๐Ÿ›ก๏ธ Security" }, + { message = "^revert", group = "โ—€๏ธ Revert" }, +] +# protect breaking changes from being skipped due to matching a skipping commit_parser +protect_breaking_commits = false +# filter out the commits that are not matched by commit parsers +filter_commits = false +# regex for matching git tags +tag_pattern = 'v\d+\.\d+\.\d+' +# regex for skipping tags +skip_tags = '^v(1|2023)\.' +# regex for ignoring tags +# ignore_tags = "" +# sort the tags topologically +topo_order = false +# sort the commits inside sections by oldest/newest order +sort_commits = "oldest" +# limit the number of commits included in the changelog. +# limit_commits = 42 diff --git a/e2e/assert.sh b/e2e/assert.sh index 5651ae6b2..1b3dfa93c 100755 --- a/e2e/assert.sh +++ b/e2e/assert.sh @@ -1,44 +1,44 @@ #!/usr/bin/env bash assert() { - local actual - actual="$(bash -c "$1")" - if [[ "$actual" != "$2" ]]; then - echo "Expected '$2' but got '$actual'" - exit 1 - fi + local actual + actual="$(bash -c "$1")" + if [[ "$actual" != "$2" ]]; then + echo "Expected '$2' but got '$actual'" + exit 1 + fi } assert_contains() { - local actual - actual="$(bash -c "$1")" - if [[ "$actual" != *"$2"* ]]; then - echo "Expected '$2' to be in '$actual'" - exit 1 - fi + local actual + actual="$(bash -c "$1")" + if [[ "$actual" != *"$2"* ]]; then + echo "Expected '$2' to be in '$actual'" + exit 1 + fi } assert_not_contains() { - local actual - actual="$(bash -c "$1")" - if [[ "$actual" == *"$2"* ]]; then - echo "Expected '$2' to not be in '$actual'" - exit 1 - fi + local actual + actual="$(bash -c "$1")" + if [[ "$actual" == *"$2"* ]]; then + echo "Expected '$2' to not be in '$actual'" + exit 1 + fi } assert_fail() { - if bash -c "$1" 2>&1; then - echo "Expected failure but succeeded" - exit 1 - fi + if bash -c "$1" 2>&1; then + echo "Expected failure but succeeded" + exit 1 + fi } assert_matches() { - local actual - actual="$(bash -c "$1")" - if [[ ! "$actual" =~ $2 ]]; then - echo "Expected '$2' to match '$actual'" - exit 1 - fi + local actual + actual="$(bash -c "$1")" + if [[ ! "$actual" =~ $2 ]]; then + echo "Expected '$2' to match '$actual'" + exit 1 + fi } diff --git a/scripts/build-deb.sh b/scripts/build-deb.sh index b98c0b08e..bcaa7ee94 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 5adb61e99..d47277b0a 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 4738819e9..cf8b9b3ef 100755 --- a/scripts/build-tarball.sh +++ b/scripts/build-tarball.sh @@ -2,75 +2,75 @@ set -euo pipefail error() { - echo "$@" >&2 - exit 1 + echo "$@" >&2 + exit 1 } NAME="$1" shift for arg in "$@"; do - if [ "${next_target:-}" = 1 ]; then - next_target= - TARGET="$arg" - continue - fi - case "$arg" in - --target) - next_target=1 - ;; - *) ;; + if [ "${next_target:-}" = 1 ]; then + next_target= + TARGET="$arg" + continue + fi + case "$arg" in + --target) + next_target=1 + ;; + *) ;; - esac + esac done RUST_TRIPLE=${TARGET:-$(rustc -vV | grep ^host: | cut -d ' ' -f2)} #region os/arch get_os() { - case "$RUST_TRIPLE" in - *-apple-darwin*) - echo "macos" - ;; - *-linux-*) - echo "linux" - ;; - *) - error "unsupported OS: $RUST_TRIPLE" - ;; - esac + case "$RUST_TRIPLE" in + *-apple-darwin*) + echo "macos" + ;; + *-linux-*) + echo "linux" + ;; + *) + error "unsupported OS: $RUST_TRIPLE" + ;; + esac } get_arch() { - case "$RUST_TRIPLE" in - aarch64-*) - echo "arm64" - ;; - arm-*) - echo "armv6" - ;; - armv7-*) - echo "armv7" - ;; - x86_64-*) - echo "x64" - ;; - universal2-*) - echo "universal" - ;; - *) - error "unsupported arch: $RUST_TRIPLE" - ;; - esac + case "$RUST_TRIPLE" in + aarch64-*) + echo "arm64" + ;; + arm-*) + echo "armv6" + ;; + armv7-*) + 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 @@ -79,11 +79,11 @@ VERSION=$(./scripts/get-version.sh) BASENAME=$NAME-$VERSION-$(get_os)-$(get_arch)$(get_suffix) if command -v cross >/dev/null; then - cross build "$@" + cross build "$@" elif command -v zig >/dev/null; then - cargo zigbuild "$@" + cargo zigbuild "$@" else - cargo build "$@" + cargo build "$@" fi mkdir -p dist/mise/bin mkdir -p dist/mise/man/man1 @@ -99,8 +99,8 @@ tar -cJf "$BASENAME.tar.xz" mise tar -czf "$BASENAME.tar.gz" mise if [ -f ~/.zipsign/mise.priv ]; then - zipsign sign tar "$BASENAME.tar.gz" ~/.zipsign/mise.priv - zipsign verify tar "$BASENAME.tar.gz" ../zipsign.pub + zipsign sign tar "$BASENAME.tar.gz" ~/.zipsign/mise.priv + zipsign verify tar "$BASENAME.tar.gz" ../zipsign.pub fi ls -oh "$BASENAME.tar.xz" diff --git a/scripts/pre-release-hook.sh b/scripts/pre-release-hook.sh deleted file mode 100755 index 746c3f808..000000000 --- a/scripts/pre-release-hook.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -if [[ "${NO_UPDATE:-}" == "1" ]]; then - echo "NO_UPDATE is set, skipping update" -# else -# cargo update && git add Cargo.lock -fi - -./scripts/update-shorthand-repo.sh -mise run render ::: lint:fix - -git add man src/default_shorthands.rs diff --git a/scripts/publish-s3.sh b/scripts/publish-s3.sh index c9456c1d1..3e6a827a6 100755 --- a/scripts/publish-s3.sh +++ b/scripts/publish-s3.sh @@ -28,18 +28,18 @@ 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 }' # rtx.pub curl --fail-with-body -X POST "https://api.cloudflare.com/client/v4/zones/80d977fd09f01db52bec165778088891/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 2f94092c7..5c82bec62 100755 --- a/scripts/release-alpine.sh +++ b/scripts/release-alpine.sh @@ -31,19 +31,19 @@ apkbuild-lint APKBUILD 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 - glab mr create --fill --yes -H jdxcode/aports -R alpine/aports - fi + if [ "$DRY_RUN" == 0 ]; then + glab mr create --fill --yes -H jdxcode/aports -R alpine/aports + fi fi #git show diff --git a/scripts/release-aur-bin.sh b/scripts/release-aur-bin.sh index 1e1639413..2b4b9a811 100755 --- a/scripts/release-aur-bin.sh +++ b/scripts/release-aur-bin.sh @@ -8,7 +8,7 @@ TAR_GZ_URI="https://github.com/jdx/mise/releases/download/$MISE_VERSION/mise-$MI SHA512=$(curl -fsSL "$TAR_GZ_URI" | sha512sum | awk '{print $1}') if [ ! -d aur-bin ]; then - git clone ssh://aur@aur.archlinux.org/mise-bin.git aur-bin + git clone ssh://aur@aur.archlinux.org/mise-bin.git aur-bin fi git -C aur-bin pull @@ -74,11 +74,11 @@ git config user.name mise-en-dev git config user.email 123107610+mise-en-dev@users.noreply.github.com git add .SRCINFO PKGBUILD if git diff-index --quiet HEAD --; then - echo "No changes to PKGBUILD or .SRCINFO" - exit 0 + echo "No changes to PKGBUILD or .SRCINFO" + exit 0 fi git diff --cached git commit -m "mise ${MISE_VERSION#v}" if [[ "$DRY_RUN" == 0 ]]; then - git push + git push fi diff --git a/scripts/release-aur.sh b/scripts/release-aur.sh index 722d392f2..6731c6801 100755 --- a/scripts/release-aur.sh +++ b/scripts/release-aur.sh @@ -6,7 +6,7 @@ MISE_VERSION=$(./scripts/get-version.sh) SHA512=$(curl -fsSL "https://github.com/jdx/mise/archive/$MISE_VERSION.tar.gz" | sha512sum | awk '{print $1}') if [ ! -d aur ]; then - git clone ssh://aur@aur.archlinux.org/mise.git aur + git clone ssh://aur@aur.archlinux.org/mise.git aur fi git -C aur pull @@ -79,11 +79,11 @@ git config user.name mise-en-dev git config user.email 123107610+mise-en-dev@users.noreply.github.com git add .SRCINFO PKGBUILD if git diff-index --quiet HEAD --; then - echo "No changes to PKGBUILD or .SRCINFO" - exit 0 + echo "No changes to PKGBUILD or .SRCINFO" + exit 0 fi git diff --cached git commit -m "mise ${MISE_VERSION#v}" if [ "$DRY_RUN" == 0 ]; then - git push + git push fi diff --git a/scripts/release-npm.sh b/scripts/release-npm.sh index 8e9743584..e36cc3665 100755 --- a/scripts/release-npm.sh +++ b/scripts/release-npm.sh @@ -2,52 +2,52 @@ 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 + 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-armv6 - linux-armv6-musl - linux-armv7 - linux-armv7-musl - macos-x64 - macos-arm64 + linux-x64 + linux-x64-musl + linux-arm64 + linux-arm64-musl + linux-armv6 + linux-armv6-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", @@ -68,16 +68,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" @@ -168,10 +168,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 c424a9afb..0882fc607 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -20,23 +20,23 @@ find artifacts -name 'tarball-*' -exec sh -c ' ' sh {} \; platforms=( - linux-x64 - linux-x64-musl - linux-arm64 - linux-arm64-musl - linux-armv6 - linux-armv6-musl - linux-armv7 - linux-armv7-musl - macos-x64 - macos-arm64 + linux-x64 + linux-x64-musl + linux-arm64 + linux-arm64-musl + linux-armv6 + linux-armv6-musl + linux-armv7 + linux-armv7-musl + macos-x64 + macos-arm64 ) for platform in "${platforms[@]}"; do - 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 -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 "$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 -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 echo "::group::Checksums" @@ -64,21 +64,21 @@ shellcheck "$RELEASE_DIR"/install.sh gpg -u 8B81C9D17413A06D --output "$RELEASE_DIR"/install.sh.sig --sign "$RELEASE_DIR"/install.sh if [[ "$DRY_RUN" != 1 ]]; then - echo "::group::Publish npm @jdxcode/mise" - NPM_PREFIX=@jdxcode/mise ./mise/scripts/release-npm.sh - # echo "::group::Publish npm mise-cli" - # NPM_PREFIX=mise-cli ./mise/scripts/release-npm.sh - echo "::group::Publish r2" - ./mise/scripts/publish-r2.sh + echo "::group::Publish npm @jdxcode/mise" + NPM_PREFIX=@jdxcode/mise ./mise/scripts/release-npm.sh + # echo "::group::Publish npm mise-cli" + # NPM_PREFIX=mise-cli ./mise/scripts/release-npm.sh + echo "::group::Publish r2" + ./mise/scripts/publish-r2.sh fi echo "::group::Publish mise-docs" cp ./mise/docs/cli-reference.md ./mise-docs/cli/index.md pushd mise-docs if [[ -z $(git status -s) ]]; then - echo "No changes to docs" + echo "No changes to docs" else - git add cli/index.md - git commit -m "mise ${MISE_VERSION#v}" + git add cli/index.md + git commit -m "mise ${MISE_VERSION#v}" fi popd diff --git a/scripts/render-homebrew.sh b/scripts/render-homebrew.sh index d9e14f3e0..e722598d3 100755 --- a/scripts/render-homebrew.sh +++ b/scripts/render-homebrew.sh @@ -3,15 +3,15 @@ set -euxo pipefail # shellcheck disable=SC2016 MISE_VERSION=${MISE_VERSION#v*} \ - MISE_CHECKSUM_LINUX_X86_64=$(grep "mise-v$MISE_VERSION-linux-x64.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_LINUX_X86_64_MUSL=$(grep "mise-v$MISE_VERSION-linux-x64-musl.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_LINUX_ARM64=$(grep "mise-v$MISE_VERSION-linux-arm64.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_LINUX_ARM64_MUSL=$(grep "mise-v$MISE_VERSION-linux-arm64-musl.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_LINUX_ARMV6=$(grep "mise-v$MISE_VERSION-linux-armv6.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_LINUX_ARMV6_MUSL=$(grep "mise-v$MISE_VERSION-linux-armv6-musl.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_LINUX_ARMV7=$(grep "mise-v$MISE_VERSION-linux-armv7.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_LINUX_ARMV7_MUSL=$(grep "mise-v$MISE_VERSION-linux-armv7-musl.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_MACOS_X86_64=$(grep "mise-v$MISE_VERSION-macos-x64.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - MISE_CHECKSUM_MACOS_ARM64=$(grep "mise-v$MISE_VERSION-macos-arm64.tar.xz" "$RELEASE_DIR/v$MISE_VERSION/SHASUMS256.txt" | cut -d ' ' -f1) \ - envsubst '$MISE_VERSION,$MISE_CHECKSUM_LINUX_X86_64,$MISE_CHECKSUM_LINUX_ARM64,$MISE_CHECKSUM_MACOS_X86_64,$MISE_CHECKSUM_MACOS_ARM64' \ - /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 623a200a0..a8b5ef1ed 100755 --- a/scripts/test-standalone.sh +++ b/scripts/test-standalone.sh @@ -14,7 +14,7 @@ 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/src/default_shorthands.rs b/src/default_shorthands.rs index b2552039a..7fd51a544 100644 --- a/src/default_shorthands.rs +++ b/src/default_shorthands.rs @@ -5,7 +5,7 @@ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // !GENERATED FILE! // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// This file is generated by scripts/update-shorthand-repo.sh +// This file is generated by .mise/tasks/update-shorthand-repo // DO NOT EDIT THIS FILE MANUALLY. YOUR PR WILL BE REJECTED. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! // !GENERATED FILE! @@ -550,7 +550,7 @@ pub static DEFAULT_SHORTHANDS: Lazy> = ("qdns", "https://github.com/moritz-makandra/asdf-plugin-qdns.git"), ("quarkus", "https://github.com/asdf-community/asdf-quarkus.git"), ("r", "https://github.com/asdf-community/asdf-r.git"), - ("rabbitmq", "https://github.com/mise-plugins/asdf-rabbitmq.git"), + ("rabbitmq", "https://github.com/w-sanches/asdf-rabbitmq.git"), ("racket", "https://github.com/asdf-community/asdf-racket.git"), ("raku", "https://github.com/m-dango/asdf-raku.git"), ("rancher", "https://github.com/abinet/asdf-rancher.git"), diff --git a/test/fixtures/signal-test.js b/test/fixtures/signal-test.js index 35032637a..c202b1fe0 100644 --- a/test/fixtures/signal-test.js +++ b/test/fixtures/signal-test.js @@ -1,14 +1,14 @@ -let i = 3 +let i = 3; -process.on('SIGINT', function () { +process.on("SIGINT", function () { if (i > 0) { - console.log(`Got SIGINT. Press Control-D to exit. ${i} times left`) - i-- + console.log(`Got SIGINT. Press Control-D to exit. ${i} times left`); + i--; } else { - process.exit() + process.exit(); } -}) +}); // wait for 60 seconds -setTimeout(function () {}, 60000) -console.log('Running. Press Control-C to test.') +setTimeout(function () {}, 60000); +console.log("Running. Press Control-C to test.");