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..730f307a41 --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,39 @@ +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: kenji-miyake/setup-git-cliff@v1 + - 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 < +""" +# 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", 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[0-9].*" +# regex for skipping tags +# skip_tags = "" +# 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 5651ae6b24..1b3dfa93c0 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/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.");