Skip to content

Commit

Permalink
Add support to publish crates
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
  • Loading branch information
fabbione committed Jun 23, 2021
1 parent b66eb35 commit fbe4019
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build-aux/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ endif
.PHONY: setup
setup: checks
./autogen.sh
./configure
./configure --enable-rust-bindings
make maintainer-clean


Expand All @@ -60,9 +60,9 @@ endif
.PHONY: tarballs
tarballs: tag
./autogen.sh
./configure
#make distcheck (disabled.. needs root)
make dist
./configure --enable-rust-bindings
make distcheck DISTCHECK_CONFIGURE_FLAGS="--enable-rust-bindings"
make all -j


.PHONY: sha256
Expand Down Expand Up @@ -102,6 +102,8 @@ else
@git push --follow-tags origin
@echo : publishing files
@scp $(deliverables) $(deliverables:=.asc) www.kronosnet.org:kronosnet/releases/.
$(MAKE) -C libnozzle/bindings/rust crates-publish
$(MAKE) -C libknet/bindings/rust crates-publish
endif


Expand Down
10 changes: 10 additions & 0 deletions build-aux/rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ publish-check:
$(CARGO) publish --dry-run; \
fi

crates-publish:
if [ -f "${abs_srcdir}/README" ]; then \
bindingname=`cat Cargo.toml | grep ^name | sed -e 's#.*= ##g' -e 's#"##g'` && \
cratesver=`cargo search $$bindingname | grep "^$$bindingname " | sed -e 's#.*= ##g' -e 's#"##g' -e 's/\+.*//g'` && \
testver=`echo $(localver) | sed -e 's/\+.*//g'` && \
if [ "$$cratesver" != "$$testver" ]; then \
$(CARGO) publish; \
fi; \
fi

crates-check:
if [ -f "${abs_srcdir}/README" ]; then \
bindingname=`cat Cargo.toml | grep ^name | sed -e 's#.*= ##g' -e 's#"##g'` && \
Expand Down

0 comments on commit fbe4019

Please sign in to comment.