File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5151
5252 - name : Cargo test
5353 run : cargo test
54+
55+ publish-check :
56+ name : Publish Check (dry-run)
57+ runs-on : ubuntu-latest
58+ steps :
59+ - uses : actions/checkout@v4
60+
61+ - name : Install Rust toolchain
62+ uses : dtolnay/rust-toolchain@stable
63+
64+ - name : Cache cargo registry
65+ uses : actions/cache@v4
66+ with :
67+ path : ~/.cargo/registry
68+ key : ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
69+
70+ - name : Cargo publish dry-run
71+ run : cargo publish --dry-run
72+
73+ main-pr-checks :
74+ name : Main PR Requirements
75+ if : github.base_ref == 'main'
76+ runs-on : ubuntu-latest
77+ steps :
78+ - uses : actions/checkout@v4
79+
80+ - name : Check version bump
81+ run : |
82+ CURRENT_VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
83+ echo "Version in Cargo.toml: $CURRENT_VERSION"
84+ LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
85+ if [ -z "$LAST_TAG" ]; then
86+ echo "✅ First release (no previous tags)"
87+ else
88+ LAST_VERSION=${LAST_TAG#v}
89+ echo "Last tag version: $LAST_VERSION"
90+ if [ "$CURRENT_VERSION" = "$LAST_VERSION" ]; then
91+ echo "❌ Version in Cargo.toml must be bumped for PRs to main"
92+ exit 1
93+ fi
94+ echo "✅ Version bumped correctly"
95+ fi
You can’t perform that action at this time.
0 commit comments