-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
97 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
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/restore@v4 | ||
with: | ||
path: | | ||
~/.local/share/mise/installs | ||
~/.local/share/mise/plugins | ||
key: v0-mise-tools-${{ hashFiles('.mise.toml') }} | ||
restore-keys: v0-mise-tools | ||
- run: mise install | ||
- run: mise run release-plz | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.MY_RELEASE_PLEASE_TOKEN }} | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/usr/bin/env bash | ||
set -euxo pipefail | ||
|
||
released_versions="$(cargo show mise --json | jq -r '.versions.[].num')" | ||
cur_version="$(cargo pkgid mise | cut -d# -f2)" | ||
if ! echo "$released_versions" | grep -q "^$cur_version$"; then | ||
echo "Releasing $cur_version" | ||
cargo publish | ||
fi | ||
|
||
version="$(git cliff --bumped-version)" | ||
changelog="$(git cliff --unreleased --strip all)" | ||
|
||
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 | ||
cargo set-version "${version#v}" | ||
cargo update | ||
git add \ | ||
Cargo.lock \ | ||
Cargo.toml \ | ||
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.