ci: fix workflow_dispatch releasing into the void

The release workflow happily accepts a manual dispatch with any tag
string, then passes it to git log and softprops/action-gh-release
without ever checking if the tag actually *exists* as a git ref.
Confusion ensues — changelog generation silently produces garbage
and the release gets created pointing at nothing useful.

Add a tag validation step that fails fast with a clear error before
any downstream jobs run. Since both build and release already depend
on the changelog job via `needs`, this acts as a proper gate.

While at it, add --all-features to the CI build and test steps so
feature-gated code actually gets compiled and tested, not just
linted by clippy. Having clippy check code that never gets built
is the kind of false confidence that bites you on release day.
This commit is contained in:
bahdotsh
2026-04-02 16:06:18 +05:30
parent bad6f65579
commit 97de44b8af
2 changed files with 10 additions and 2 deletions

View File

@@ -42,6 +42,6 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --workspace
- run: cargo build --workspace --all-features
- run: cargo check --no-default-features --workspace
- run: cargo test --workspace
- run: cargo test --workspace --all-features

View File

@@ -26,6 +26,14 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Validate tag exists
env:
RELEASE_TAG: ${{ inputs.tag || github.ref_name }}
run: |
if ! git rev-parse "${RELEASE_TAG}" >/dev/null 2>&1; then
echo "::error::Tag ${RELEASE_TAG} does not exist in the repository"
exit 1
fi
- name: Generate changelog
id: changelog
env: