From bce83928b2839fb43cc6ce834dbb558c71882e05 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 --- .editorconfig | 2 +- .github/workflows/release-plz.yml | 40 ++++ .mise/tasks/pre-release | 21 ++ .../tasks/update-shorthand-repo | 2 +- .prettierignore | 1 + Cargo.lock | 184 +++++++++--------- Cargo.toml | 5 +- README.md | 6 +- e2e/assert.sh | 56 +++--- release-plz.toml | 5 + scripts/pre-release-hook.sh | 13 -- src/default_shorthands.rs | 4 +- test/fixtures/signal-test.js | 16 +- 13 files changed, 204 insertions(+), 151 deletions(-) create mode 100644 .github/workflows/release-plz.yml create mode 100755 .mise/tasks/pre-release rename scripts/update-shorthand-repo.sh => .mise/tasks/update-shorthand-repo (97%) create mode 100644 .prettierignore create mode 100644 release-plz.toml delete mode 100755 scripts/pre-release-hook.sh diff --git a/.editorconfig b/.editorconfig index ac106646c7..dc11b59acb 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,7 +2,7 @@ indent_style = space indent_size = 2 -[*.sh] +[{*.sh,.mise/tasks/**/*}] indent_style = space indent_size = 2 diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 0000000000..832d8fb32a --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,40 @@ +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: taiki-e/install-action@git-cliff + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + with: + shared-key: unit + save-if: false + - run: mkdir -p $HOME/bin && echo "$HOME/bin" >> "$GITHUB_PATH" + - run: | + cargo build + cp target/debug/mise $HOME/bin + mise trust --all + mise settings set experimental true + - run: mise run pre-release + - uses: MarcoIeni/release-plz-action@v0.5 + env: + GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.mise/tasks/pre-release b/.mise/tasks/pre-release new file mode 100755 index 0000000000..7658fb4e9e --- /dev/null +++ b/.mise/tasks/pre-release @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euxo pipefail + +version="$(git cliff --bumped-version)" +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 add \ + README.md \ + default.nix \ + packaging/rpm/mise.spec \ + src/default_shorthands.rs \ + mise.usage.kdl \ + completions \ + man/ + +git clean -df 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 cbd19a7960..e5145221cc 100755 --- a/scripts/update-shorthand-repo.sh +++ b/.mise/tasks/update-shorthand-repo @@ -17,7 +17,7 @@ cat >src/default_shorthands.rs <&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/release-plz.toml b/release-plz.toml new file mode 100644 index 0000000000..cc2ea67d29 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,5 @@ +[workspace] +allow_dirty = true +dependencies_update = true +pr_labels = ["release"] +semver_check = false diff --git a/scripts/pre-release-hook.sh b/scripts/pre-release-hook.sh deleted file mode 100755 index 746c3f8085..0000000000 --- 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/src/default_shorthands.rs b/src/default_shorthands.rs index b2552039a2..7fd51a544e 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 35032637a4..c202b1fe04 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.");