diff --git a/.github/workflows/build-push-docker-prod.yml b/.github/workflows/build-push-docker-prod.yml deleted file mode 100644 index 138c08d..0000000 --- a/.github/workflows/build-push-docker-prod.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Build Docker image of the GEOKUBE component and push to the production repository - -on: - push: - tags: - - 'v*' -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get release tag - run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - uses: actions/setup-python@v1 - with: - python-version: 3.11 - - name: Install WHEEL tool - run: pip install wheel - - name: Build WHEEL file - run: python setup.py bdist_wheel - - name: Login to Docker registry - run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login ${{ secrets.DOCKER_PROD_REPO_URL }} -u nologin --password-stdin - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - file: ./Dockerfile - push: true - tags: | - ${{ secrets.DOCKER_PROD_REPO_URL }}/geokube:${{ env.RELEASE_TAG }} - ${{ secrets.DOCKER_PROD_REPO_URL }}/geokube:latest diff --git a/.github/workflows/build-push-docker.yml b/.github/workflows/build-push-docker_pr.yml similarity index 69% rename from .github/workflows/build-push-docker.yml rename to .github/workflows/build-push-docker_pr.yml index 8e4f9fd..b28b939 100644 --- a/.github/workflows/build-push-docker.yml +++ b/.github/workflows/build-push-docker_pr.yml @@ -1,4 +1,4 @@ -name: Build Docker image of the GEOKUBE component and push to the dev repository +name: Build geokube Docker image and push to geokube container registry on: pull_request: @@ -13,7 +13,7 @@ jobs: run: echo "TAG=$(date +'%Y.%m.%d.%H.%M')" >> $GITHUB_ENV - uses: actions/setup-python@v1 with: - python-version: 3.11 + python-version: 3.9 - name: Install WHEEL tool run: pip install wheel - name: Build WHEEL file @@ -22,8 +22,8 @@ jobs: uses: docker/login-action@v2 with: username: nologin - password: ${{ secrets.DOCKER_PASSWORD }} - registry: ${{ secrets.DOCKER_DEV_REPO_URL }} + password: ${{ secrets.SCALEWAY_PASSWORD }} + registry: ${{ vars.GEOKUBE_REGISTRY }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 - name: Build and push @@ -33,5 +33,5 @@ jobs: file: ./Dockerfile push: true tags: | - ${{ secrets.DOCKER_DEV_REPO_URL }}/geokube:${{ env.TAG }} - ${{ secrets.DOCKER_DEV_REPO_URL }}/geokube:latest + ${{ vars.GEOKUBE_REGISTRY }}/geokube:${{ env.TAG }} + ${{ vars.GEOKUBE_REGISTRY }}/geokube:latest \ No newline at end of file diff --git a/.github/workflows/build-push-docker_release.yml b/.github/workflows/build-push-docker_release.yml new file mode 100644 index 0000000..55431e5 --- /dev/null +++ b/.github/workflows/build-push-docker_release.yml @@ -0,0 +1,35 @@ +name: Build on release a geokube Docker image and push to the geokube container registry + +on: + push: + tags: + - 'v*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Get release tag + run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.9" + - name: Install WHEEL tool + run: pip install wheel + - name: Build WHEEL file + run: python setup.py bdist_wheel + - name: Login to Scaleway Container Registry + uses: docker/login-action@v2 + with: + username: nologin + password: ${{ secrets.SCALEWAY_PASSWORD }} + registry: ${{ vars.GEOKUBE_REGISTRY }} + - name: Set up Docker Buildx + uses: docker/build-push-action@v4 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ vars.GEOKUBE_REGISTRY }}/geokube:${{ env.TAG }} \ No newline at end of file diff --git a/.github/workflows/pypi_publish.yml b/.github/workflows/pypi_publish.yml new file mode 100644 index 0000000..e85051d --- /dev/null +++ b/.github/workflows/pypi_publish.yml @@ -0,0 +1,30 @@ +name: Publish Kit4DL package to PyPI + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-and-publish: + name: Build Kit4DL and publish to PyPI + strategy: + matrix: + python-version: ["3.9"] + os: [ubuntu-latest] + runs-on: ${{ matrix.os }} + environment: release + permissions: + id-token: write + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install build tool + run: python3 -m pip install build --user + - name: Build wheels + run: python -m build --sdist --wheel --outdir=dist/ . + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 \ No newline at end of file diff --git a/.github/workflows/testpypi_publish.yml b/.github/workflows/testpypi_publish.yml new file mode 100644 index 0000000..6979cac --- /dev/null +++ b/.github/workflows/testpypi_publish.yml @@ -0,0 +1,34 @@ +name: Publish geokube package to TestPyPI + +on: + release: + types: [prereleased] + workflow_dispatch: + +jobs: + build-and-publish: + name: Build geokube and publish to TestPyPI + strategy: + matrix: + python-version: ["3.9"] + os: [ubuntu-latest] +# environment: +# name: testpypi +# url: https://test.pypi.org/p/geokube + permissions: + id-token: write + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install build tool + run: python3 -m pip install build --user + - name: Build wheels + run: python -m build --sdist --wheel --outdir=dist/ . + - name: Publish package distributions to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 86913e9..4ab8b02 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN conda clean -afy \ && find /opt/conda/ -follow -type f -name '*.pyc' -delete \ && find /opt/conda/ -follow -type f -name '*.js.map' -delete \ && find /opt/conda/lib/python*/site-packages/bokeh/server/static -follow -type f -name '*.js' ! -name '*.min.js' -delete -COPY dist/geokube-0.2a0-py3-none-any.whl / +COPY dist/geokube-0.2.7-py3-none-any.whl / RUN pip install /geokube-0.2a0-py3-none-any.whl -RUN rm /geokube-0.2a0-py3-none-any.whl -ENV LD_LIBRARY_PATH=/opt/conda/x86_64-conda-linux-gnu/lib:/usr/lib/x86_64-linux-gnu +RUN rm /geokube-0.2.7-py3-none-any.whl +ENV LD_LIBRARY_PATH=/opt/conda/x86_64-conda-linux-gnu/lib:/usr/lib/x86_64-linux-gnu \ No newline at end of file diff --git a/geokube/version.py b/geokube/version.py index 03a5849..49f34f4 100644 --- a/geokube/version.py +++ b/geokube/version.py @@ -1 +1 @@ -__version__ = "0.2a0" +__version__ = "0.2.0" \ No newline at end of file diff --git a/setup.py b/setup.py index 320668c..9c61ecc 100644 --- a/setup.py +++ b/setup.py @@ -18,7 +18,7 @@ description="Python package for Earth Science Data Analysis", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/geokube/geokube", + url="https://github.com/CMCC-Foundation/geokube", packages=setuptools.find_packages(), install_requires=[ "pytest-cov",