Skip to content

Prepare for 1.9.21 release #6147

Prepare for 1.9.21 release

Prepare for 1.9.21 release #6147

Workflow file for this run

name: build
on:
pull_request:
push:
branches:
- develop
paths:
- '**'
- '!docs/**'
- '!contrib/**'
release:
types:
- published
workflow_dispatch:
env:
DOCKER_IMAGE: ghcr.io/opendatacube/datacube-core:tests
permissions: {}
# When a PR is updated, cancel the jobs from the previous version. Merges
# do not define head_ref, so use run_id to never cancel those jobs.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
main:
timeout-minutes: 55
runs-on: ubuntu-latest
# Permit authenticating to PyPI/CodeCov.
permissions:
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Get Git commit timestamps
run: |
TIMESTAMP=$(git log -1 --pretty=%ct pyproject.toml uv.lock datacube examples)
echo "TIMESTAMP=$TIMESTAMP" >> $GITHUB_ENV
- name: Build Docker
uses: docker/build-push-action@f9f3042f7e2789586610d6e8b85c8f03e5195baf # v7.2.0
with:
file: docker/Dockerfile
context: .
tags: ${{ env.DOCKER_IMAGE }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
env:
SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }}
- name: Verify and Run Tests
run: |
export LOCAL_UID=$(id -u $USER)
export LOCAL_GID=$(id -g $USER)
docker compose up --quiet-pull --wait -d
docker compose exec --user ubuntu -T core /bin/bash --login -c \
"source /app/bin/activate && \
rio --show-versions && \
pytest -r a \
--cov datacube \
--cov-report=xml \
--doctest-ignore-import-errors \
--durations=5 \
datacube \
tests \
integration_tests"
docker compose down
- name: Upload coverage to Codecov
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
with:
files: ./coverage.xml
disable_search: true
fail_ci_if_error: false
use_oidc: true
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Build Packages
run: |
uv build
uv tool run twine check --strict dist/*
# Uses to OIDC identification between GitHub and PyPI
- name: Upload package to PyPI on GitHub Release
if: "github.repository_owner == 'opendatacube' && github.event.action == 'published'"
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0