* github-actions: install missing cython package for creating sdist wheel

* remove VERSION from gitignore and keep VERSION file
This commit is contained in:
Mario Fink 2021-09-21 15:56:24 +02:00
parent 71a39e90e4
commit a099849caa
5 changed files with 24 additions and 13 deletions

View File

@ -30,6 +30,8 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Install cython
run: python -m pip install cython==0.29.24
- name: Build sdist - name: Build sdist
run: python setup.py sdist run: python setup.py sdist
working-directory: python/ working-directory: python/

1
.gitignore vendored
View File

@ -35,7 +35,6 @@ pip/build/
python/README.md python/README.md
python/LICENSE python/LICENSE
python/VERSION
python/build python/build
python/*.egg-info python/*.egg-info
python/dist python/dist

View File

@ -18,8 +18,9 @@ CC = g++ -std=c++17
OPT = -O3 -Wall -Wconversion -Wpedantic -Werror -Wunused-variable -Wsign-compare OPT = -O3 -Wall -Wconversion -Wpedantic -Werror -Wunused-variable -Wsign-compare
# determine git version/commit and release tag # determine git version/commit and release tag
GTAG := $(shell git tag -l --sort=version:refname | tail -n1) GTAG := $(shell git tag -l --sort=version:refname | tail -n1 | sed "s/$^v//g")
GHSH := $(shell git rev-parse HEAD | head -c8) GHSH := $(shell git rev-parse HEAD | head -c8)
GVSN := $(shell cat python/VERSION | tr -d ' \n')
# current timestamp # current timestamp
TMS = $(shell date +%Y%m%dT%H%M%S) TMS = $(shell date +%Y%m%dT%H%M%S)
@ -31,11 +32,11 @@ INST := /usr/local/bin
# C++ and CLI tool # C++ and CLI tool
# build exectuable # build exectuable
$(EXE) : main.o $(EXE): check-tags $(GVSN) main.o
$(CC) $(OPT) main.o -o $@ $(CC) $(OPT) main.o -o $@
# build main.cpp and include git version/commit tag # build main.cpp and include git version/commit tag
main.o : src/main.cpp $(HPP) main.o: src/main.cpp $(HPP)
@cp $< $<.cpp @cp $< $<.cpp
@sed -i 's/TAGSTRING/$(GTAG)/g' $<.cpp @sed -i 's/TAGSTRING/$(GTAG)/g' $<.cpp
@sed -i 's/HASHSTRING/$(GHSH)/g' $<.cpp @sed -i 's/HASHSTRING/$(GHSH)/g' $<.cpp
@ -43,13 +44,13 @@ main.o : src/main.cpp $(HPP)
$(CC) -c $(OPT) -I $(LIB) $<.cpp -o $@ $(CC) -c $(OPT) -I $(LIB) $<.cpp -o $@
@rm $<.cpp @rm $<.cpp
install : $(EXE) install: $(EXE)
cp $< $(INST)/ cp $< $(INST)/
uninstall : $(INST)/$(EXE) uninstall: $(INST)/$(EXE)
rm $< rm $<
cpp-clean : cpp-clean:
rm -vf $(EXE) rm -vf $(EXE)
rm -vf *.o rm -vf *.o
@ -59,10 +60,21 @@ cpp-clean :
check-code: check-code:
cppcheck --enable=all -I lib/ src/main.cpp cppcheck --enable=all -I lib/ src/main.cpp
#-----------------------------------------------------------------------------#
# versions
$(GTAG):
@echo "consistent versions check successful: building $(GTAG)"
check-tags:
@echo "latest git tag: $(GTAG)"
@echo "latest git hash: $(GHSH)"
@echo "python version: $(GVSN)"
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
# Docker # Docker
docker-build : docker-build:
docker build ./ --tag imctermite:0.1 docker build ./ --tag imctermite:0.1
docker-run: docker-run:
@ -71,7 +83,7 @@ docker-run:
#-----------------------------------------------------------------------------# #-----------------------------------------------------------------------------#
# python # python
python-build: python-build: check-tags $(GVSN)
make -C python/ build-inplace make -C python/ build-inplace
cp python/IMCtermite*.so ./ -v cp python/IMCtermite*.so ./ -v

1
python/VERSION Normal file
View File

@ -0,0 +1 @@
2.0.0

View File

@ -1,14 +1,11 @@
GITAG := $(shell git tag -l --sort=version:refname | tail -n1 | sed 's/^v//g')
setup: setup:
echo $(GITAG) > VERSION
cat ../README.md | grep '^# IMCtermite' -A 50000 > ./README.md cat ../README.md | grep '^# IMCtermite' -A 50000 > ./README.md
cp -r ../lib ./ cp -r ../lib ./
cp -v ../LICENSE ./ cp -v ../LICENSE ./
setup-clean: setup-clean:
rm -vf README.md VERSION LICENSE rm -vf README.md LICENSE
rm -rf lib/ rm -rf lib/
build: setup build: setup