-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (32 loc) · 1.43 KB
/
build-openvisuspy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: build-openvisus
on: [push]
jobs:
build-ubuntu:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ '3.9', '3.10']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: |
set -ex
GIT_TAG=`git describe --tags --exact-match 2>/dev/null || true`
if [[ "${GIT_TAG}" != "" ]] ; then
python3 -m pip install --upgrade pip
python3 -m pip install hatch
python3 -m build . --wheel
hatch publish --yes --no-prompt --user ${{ secrets.PYPI_USERNAME }} --client-key ${{ secrets.PYPI_TOKEN }}
# get last OpenVisus version
python3 -m pip install --upgrade OpenVisusNoGui
OPENVISUS_VERSION=$(python3 -c "from importlib.metadata import version;print(version('OpenVisusNoGui'))")
# build and publish docker
docker build --build-arg="OPENVISUS_VERSION=${OPENVISUS_VERSION}" --build-arg="GIT_TAG=${GIT_TAG}" --tag nsdf/openvisuspy:${GIT_TAG} ./
echo ${{ secrets.DOCKER_TOKEN }} | docker login -u=${{ secrets.DOCKER_USERNAME }} --password-stdin
docker push nsdf/openvisuspy:${GIT_TAG}
docker push nsdf/openvisuspy:latest
fi