Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ jobs:
echo "=================="
echo "${RELEASES}" | jq -rM
echo "=================="
release_tag=$(echo "${RELEASES}" | jq -r '.[] | select(.package_name == "midenc" or .package_name == "cargo-miden") | .tag' | head -n1)
# `cargo-miden` owns the GitHub release/tag (see `release-plz.toml`), and it uses an
# unprefixed tag name like `v0.7.0`. Other crates may report prefixed tags (e.g.
# `midenc-v0.7.0`) which do not correspond to an actual GitHub release.
release_tag=$(echo "${RELEASES}" | jq -r '.[] | select(.package_name == "cargo-miden") | .tag' | head -n1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might add a sorting step if there's a chance of having multiple matches for the select.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! It should be only one package named cargo-miden.

if [ -z "${release_tag}" ] || [ "${release_tag}" = "null" ]; then
echo "midenc or cargo-miden crate was not released in this run. Skipping artifact upload."
echo "cargo-miden crate was not released in this run. Skipping artifact upload."
echo "release_tag=" >> "${GITHUB_OUTPUT}"
exit 0
fi
Expand Down Expand Up @@ -130,7 +133,12 @@ jobs:
release:
name: prepare the next release
runs-on: ubuntu-latest
if: ${{ github.repository_owner == '0xMiden' }}
needs: publish
# Only prepare the next release if we didn't just create a release.
# When a release PR is merged, the `publish` job will create tags/releases and publish to crates.io.
# Running `release-pr` in the same workflow run before publishing completes can create a duplicate
# release PR for the same version bump.
if: ${{ github.repository_owner == '0xMiden' && needs.publish.result == 'success' && needs.publish.outputs.releases_created != 'true' }}
permissions:
contents: write
pull-requests: write
Expand Down
4 changes: 2 additions & 2 deletions release-plz.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ changelog_path = "./CHANGELOG.md"
name = "cargo-miden"
git_release_enable = true
git_tag_enable = true
git_tag_name = "{{ version }}"
git_release_name = "{{ version }}"
git_tag_name = "v{{ version }}"
git_release_name = "v{{ version }}"


[changelog]
Expand Down
Loading