Skip to content

Commit

Permalink
chore: cargo update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Mar 17, 2024
1 parent 0ccdf36 commit 30171f4
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 27 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release-plz.yml
Original file line number Diff line number Diff line change
@@ -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 }}
31 changes: 31 additions & 0 deletions .mise/tasks/release-plz
Original file line number Diff line number Diff line change
@@ -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#v}/" README.md
sed -i.bak "s/^Version: [0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?$/Version: ${version#v}/" packaging/rpm/mise.spec
sed -i.bak "s/version = \"[0-9]\+\.[0-9]\+\.[0-9]\+\(-rc\.[0-9]\+\)\?\";$/version = \"${version#v}\";/" default.nix

mise run update-shorthand-repo
mise run render ::: lint-fix

git config user.name mise-en-dev
git config user.email [email protected]
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"
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cat >src/default_shorthands.rs <<EOF
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !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!
Expand Down
11 changes: 0 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,6 @@ native-tls = ["reqwest/native-tls"]
rustls = ["reqwest/rustls-tls", "self_update/rustls"]
rustls-native-roots = ["reqwest/rustls-tls-native-roots", "self_update/rustls"]

[package.metadata.release]
allow-branch = ["main"]
sign-tag = true
sign-commit = true
pre-release-hook = "./scripts/pre-release-hook.sh"
pre-release-replacements = [
{ file = "README.md", search = "^mise [0-9]+.[0-9]+.[0-9]+(-rc.[0-9]+)?$", replace = "mise {{version}}", exactly = 1 },
{ file = "packaging/rpm/mise.spec", search = "^Version: [0-9]+.[0-9]+.[0-9]+(-rc.[0-9]+)?$", replace = "Version: {{version}}", exactly = 1 },
{ file = "default.nix", search = "version = \"[0-9]+.[0-9]+.[0-9]+(-rc.[0-9]+)?\";$", replace = "version = \"{{version}}\";", exactly = 1 },
]

[package.metadata.binstall]
bin-dir = "mise/bin/mise"
[package.metadata.binstall.overrides.aarch64-apple-darwin]
Expand Down
13 changes: 0 additions & 13 deletions scripts/pre-release-hook.sh

This file was deleted.

4 changes: 2 additions & 2 deletions src/default_shorthands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -550,7 +550,7 @@ pub static DEFAULT_SHORTHANDS: Lazy<HashMap<&'static str, &'static str>> =
("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"),
Expand Down

0 comments on commit 30171f4

Please sign in to comment.