diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45fbaf3..e57cff5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,15 +14,13 @@ on: jobs: build: - name: py${{ matrix.python-version }} @ ${{ matrix.os }} + name: py${{ matrix.python-version }}@${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: include: - os: "ubuntu-latest" python-version: '3.8' # first supported -# - os: "windows-latest" -# python-version: '3.8' # first supported - os: "ubuntu-latest" python-version: '3.12' # latest supported - os: "windows-latest" @@ -89,8 +87,9 @@ jobs: python setup.py sdist --dist-dir artifacts/dist fi ls artifacts/dist - coveralls: - name: Submit Coveralls 👚 + + publish-coverage: + name: Publish Coverage 👚 needs: build runs-on: ubuntu-latest container: python:3-slim @@ -100,8 +99,10 @@ jobs: pip3 install --upgrade coveralls && coveralls --service=github --finish env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - publish: - name: Upload to PyPI 🚀 + + publish-pypi-package: + name: Publish PyPI 🚀 + # Will only trigger when the Tests have passed, and this is a release / tag branch from the TUW-GEO repository if: startsWith(github.ref, 'refs/tags/v') && startsWith(github.repository, 'TUW-GEO') needs: build runs-on: ubuntu-latest @@ -126,4 +127,44 @@ jobs: verify_metadata: true packages_dir: Artifacts/dist/ user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} # this needs to be uploaded to github actions secrets \ No newline at end of file + password: ${{ secrets.PYPI_API_TOKEN }} # this needs to be uploaded to github actions secrets + + publish-docker-image: + name: Publish Docker 📦 + # Will only trigger when the Tests have passed, and this is a release / tag branch from the TUW-GEO repository + if: startsWith(github.ref, 'refs/tags/v') && startsWith(github.repository, 'TUW-GEO') + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + attestations: write + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Docker image + id: push + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index c3f2bc0..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Create and publish a Docker image -on: - workflow_dispatch: # can be trigger manually (tag: ) - push: # ... or on version tags / release (tag: , "latest") - tags: - - 'v*' -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - attestations: write - id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - name: Build and push Docker image - id: push - uses: docker/build-push-action@v6 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 6a000a3..52589fa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,6 @@ RUN micromamba install -y -n base -f /app/environment.yml && pip install /app/. RUN micromamba clean --all --yes # Clean up the src code, as it is installed now -RUN rm -rf smos +RUN rm -rf /app ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"] \ No newline at end of file diff --git a/README.rst b/README.rst index b0114ec..2444bb3 100644 --- a/README.rst +++ b/README.rst @@ -38,7 +38,8 @@ Before installing this package via pip, please install the necessary .. code:: - $ conda install -c conda-forge netcdf4 pyresample + $ conda create -n smos python=3.12 + $ conda env update -f environment.yml -n smos Then @@ -86,9 +87,9 @@ Supported Products Currently the following products are supported, additional products can be added. -- `SMOS IC `_: SMOS INRA-CESBIO (SMOS-IC) 25km -- `SMOS L4 RZSM `_: SMOS CATDS-CESBIO (SMOS L4 RZSM) 25km -- SMOS L2 +- `SMOS IC `_: SMOS INRA-CESBIO (SMOS-IC) 25 km +- `SMOS L4 RZSM `_: SMOS CATDS-CESBIO (SMOS L4 RZSM) 25 km +- `SMOS L2 Science Product `_: SMOS L2 Science Products (MIR_SMUDP2) 25 km - SMOS L3 Build Docker image