File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Crate
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ workflow_dispatch : # Permite ejecutar manualmente desde la interfaz de GitHub
8+
9+ jobs :
10+ publish :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v4
16+
17+ - name : Install Rust
18+ uses : actions/setup-rust@v1
19+ with :
20+ rust-version : stable
21+
22+ - name : Check version consistency
23+ run : |
24+ TAG_VERSION="${GITHUB_REF#refs/tags/v}"
25+ CRATE_VERSION=$(cargo metadata --no-deps --format-version=1 | jq -r '.packages[0].version')
26+ if [ "$TAG_VERSION" != "$CRATE_VERSION" ]; then
27+ echo "Tag version (v$TAG_VERSION) does not match Cargo.toml version ($CRATE_VERSION)"
28+ exit 1
29+ fi
30+
31+ - name : Publish to crates.io
32+ run : cargo publish --dry-run
33+ env :
34+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
You can’t perform that action at this time.
0 commit comments