Skip to content

Commit 2f3a5fd

Browse files
authored
CI: Don't run semver job for cli package (#43)
* CI: Don't run semver job for cli package #### Problem The semver job is failing during publish because the CLI package has no lib target. #### Summary of changes I went through a few iterations on this, including a complicated cargo metadata | jq command to see if there were any lib targets on the crate, and then decided it would be easier to just not run the job for the cli package. And then while doing that, I found out that there's no way to easily say: * don't run a set of steps * still mark the job as successful for later jobs that require it to be successful So I added the "if" line to a bunch of steps in the semver job. * Add if condition to all steps
1 parent f3a26a1 commit 2f3a5fd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.github/workflows/publish-rust.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,25 +77,30 @@ jobs:
7777
runs-on: ubuntu-latest
7878
steps:
7979
- name: Git checkout
80+
if: ${{ inputs.package_path != "clients/cli" }}
8081
uses: actions/checkout@v4
8182

8283
- name: Setup Environment
84+
if: ${{ inputs.package_path != "clients/cli" }}
8385
uses: ./.github/actions/setup
8486
with:
8587
cargo-cache-key: cargo-publish-semver-${{ inputs.package_path }}
8688
cargo-cache-fallback-key: cargo-publish-semver
8789

8890
- name: Install cargo-semver-checks
91+
if: ${{ inputs.package_path != "clients/cli" }}
8992
uses: taiki-e/install-action@v2
9093
with:
9194
tool: cargo-semver-checks,cargo-release
9295

9396
- name: Set Git Author (required for cargo-release)
97+
if: ${{ inputs.package_path != "clients/cli" }}
9498
run: |
9599
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
96100
git config --global user.name "github-actions[bot]"
97101
98102
- name: Set Version
103+
if: ${{ inputs.package_path != "clients/cli" }}
99104
run: |
100105
if [ "${{ inputs.level }}" == "version" ]; then
101106
LEVEL=${{ inputs.version }}
@@ -105,6 +110,7 @@ jobs:
105110
cargo release $LEVEL --manifest-path "${{ inputs.package_path }}/Cargo.toml" --no-tag --no-publish --no-push --no-confirm --execute
106111
107112
- name: Check semver
113+
if: ${{ inputs.package_path != "clients/cli" }}
108114
run: pnpm rust:semver --manifest-path "${{ inputs.package_path }}/Cargo.toml"
109115

110116
publish:

0 commit comments

Comments
 (0)