mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2026-09-01 19:50:23 +02:00
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:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user