Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for Release 0.9.2 #315

Open
wants to merge 76 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
fb00d97
update scripts/ci
bitner Oct 29, 2024
0760e19
update scripts/ci
bitner Oct 29, 2024
46aadfd
update scripts/ci
bitner Oct 29, 2024
302bb67
update scripts/ci
bitner Oct 29, 2024
61b468c
update scripts/ci
bitner Oct 29, 2024
10b4d6b
update scripts/ci
bitner Oct 29, 2024
b59e82f
update scripts/ci
bitner Oct 29, 2024
392d7c2
update scripts/ci
bitner Oct 29, 2024
e66f43a
update scripts/ci
bitner Oct 29, 2024
0528388
update scripts/ci
bitner Oct 29, 2024
5ce6106
update scripts/ci
bitner Oct 29, 2024
c60f45c
update scripts/ci
bitner Oct 29, 2024
42f3fe6
update scripts/ci
bitner Oct 29, 2024
6b8d3b4
update scripts/ci
bitner Oct 29, 2024
5c518e9
update scripts/ci
bitner Oct 29, 2024
96388f0
update scripts/ci
bitner Oct 29, 2024
cb249ad
update scripts/ci
bitner Oct 29, 2024
55d000d
update scripts/ci
bitner Oct 29, 2024
feb1258
update scripts/ci
bitner Oct 29, 2024
8d2ff57
update scripts/ci
bitner Oct 29, 2024
0feda81
update scripts/ci
bitner Oct 29, 2024
49b8fed
update scripts/ci
bitner Oct 29, 2024
aa1ddf0
update scripts/ci
bitner Oct 29, 2024
22851cd
update scripts/ci
bitner Oct 29, 2024
aaf2fd6
update scripts/ci
bitner Oct 29, 2024
9590047
update scripts/ci
bitner Oct 29, 2024
fa50efd
update scripts/ci
bitner Oct 29, 2024
b8b2e4b
update scripts/ci
bitner Oct 29, 2024
6de6af3
update scripts/ci
bitner Oct 30, 2024
ac98670
update scripts/ci
bitner Oct 30, 2024
3ed1e3c
update scripts/ci
bitner Oct 30, 2024
2c36106
fix ci
bitner Oct 30, 2024
c2280e9
fix ci
bitner Oct 30, 2024
08cbf83
fix ci
bitner Oct 30, 2024
f0bbdcc
fix ci
bitner Oct 30, 2024
a110a06
fix ci
bitner Oct 30, 2024
6adc076
fix ci
bitner Oct 30, 2024
b4f2c1e
fix ci
bitner Oct 30, 2024
1af22e8
fix ci
bitner Oct 30, 2024
51c285e
fix ci
bitner Oct 30, 2024
79464ff
fix ci
bitner Oct 31, 2024
ad61f4b
fix ci
bitner Oct 31, 2024
362148d
fix ci
bitner Oct 31, 2024
6b0a987
fix ci
bitner Oct 31, 2024
0ff9aaf
fix ci
bitner Oct 31, 2024
9422c8c
fix ci
bitner Oct 31, 2024
fa7ad43
fix ci
bitner Oct 31, 2024
132f7f1
fix ci
bitner Oct 31, 2024
93a3d92
fix ci
bitner Oct 31, 2024
0b726a8
fix ci
bitner Oct 31, 2024
e462253
fix ci
bitner Oct 31, 2024
0914bc1
fix ci
bitner Oct 31, 2024
a3ccfbd
fix ci
bitner Oct 31, 2024
d0ca895
fix ci
bitner Oct 31, 2024
291ea35
fix ci
bitner Oct 31, 2024
9f3ab6c
fix ci
bitner Oct 31, 2024
d38e9e2
fix ci
bitner Oct 31, 2024
8500715
fix ci
bitner Oct 31, 2024
6c55cc0
fix ci
bitner Oct 31, 2024
1befd0d
fix ci
bitner Oct 31, 2024
417af63
fix ci
bitner Oct 31, 2024
d58ccd7
fix ci
bitner Oct 31, 2024
993901b
fix ci
bitner Oct 31, 2024
dadce80
fix ci
bitner Oct 31, 2024
82bc351
fix ci
bitner Oct 31, 2024
6d9985a
fix ci
bitner Nov 7, 2024
78acb73
fix ci
bitner Nov 7, 2024
29af172
fix ci
bitner Nov 7, 2024
12199b3
fix ci
bitner Nov 7, 2024
459b6f1
fix ci
bitner Nov 7, 2024
d4c3792
fix ci
bitner Nov 7, 2024
6df0d1e
fix ci
bitner Nov 7, 2024
951cd0c
fix ci
bitner Nov 7, 2024
0a42c79
fix ci
bitner Nov 7, 2024
88c8769
fix ci
bitner Nov 7, 2024
9fc1515
fix ci
bitner Nov 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
302 changes: 302 additions & 0 deletions .github/workflows/civ2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,302 @@
name: CI

on:
push:
branches:
- main
pull_request:

env:
REGISTRY: ghcr.io
REGISTRYPATH: ghcr.io/stac-utils
DOCKER_BUILDKIT: 1



jobs:
check-pgstac-base:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
pgstac-image-exists: ${{ steps.pgstac_image_check.outputs.pgstac-image-exists }}
pgstac-image-hash: ${{ steps.pgstac_image_check.outputs.pgstac-image-hash }}

steps:
- uses: actions/checkout@v4
- name: Check if pgstac-base docker image needs to be updated
id: pgstac_image_check
run: |
set -e
IMAGE=stac-utils/pgstac-base
HASH=$(git log -1 --pretty="format:%h" -- docker/pgstac)
TAG="\"$HASH\""
TOKEN=$(curl -s https://ghcr.io/token\?scope\="repository:$IMAGE:pull" | jq -r .token)
EXISTS=$(curl -s -H "Authorization: Bearer $TOKEN" https://ghcr.io/v2/$IMAGE/tags/list | jq "try(any(.tags[]; . == $TAG))")
echo "pgstac-image-exists=$EXISTS" >>$GITHUB_OUTPUT
echo "pgstac-image-hash=$HASH" >>$GITHUB_OUTPUT
echo "pgstac-image-exists: $EXISTS"
echo "pgstac-image-hash: $HASH"

buildpg:
name: Build and push base postgres image
needs: [check-pgstac-base]
if: ${{ needs.check-pgstac-base.outputs.pgstac-image-exists != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Display inputs
run: |
echo "Inputs:"
echo ${{ needs.check-pgstac-base.outputs.pgstac-image-exists }}
echo ${{ needs.check-pgstac-base.outputs.pgstac-image-hash }}
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Base Postgres
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: .
target: pgstacbase
file: docker/pgstac/Dockerfile
tags: ${{ env.REGISTRYPATH }}/pgstac-base:${{ needs.check-pgstac-base.outputs.pgstac-image-hash }}
push: true
cache-from: type=gha
cache-to: type=gha, mode=max

check-pypgstac-base:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
pypgstac-image-exists: ${{ steps.pypgstac_image_check.outputs.pypgstac-image-exists }}
pypgstac-image-hash: ${{ steps.pypgstac_image_check.outputs.pypgstac-image-hash }}

steps:
- uses: actions/checkout@v4
- name: Check if pypgstac-base docker image needs to be updated
id: pypgstac_image_check
run: |
set -e
IMAGE=stac-utils/pypgstac-base
HASH=$(git log -1 --pretty="format:%h" -- docker/pypgstac)
TAG="\"$HASH\""
TOKEN=$(curl -s https://ghcr.io/token\?scope\="repository:$IMAGE:pull" | jq -r .token)
EXISTS=$(curl -s -H "Authorization: Bearer $TOKEN" https://ghcr.io/v2/$IMAGE/tags/list | jq "try(any(.tags[]; . == $TAG))")
echo "pypgstac-image-exists=$EXISTS" >>$GITHUB_OUTPUT
echo "pypgstac-image-hash=$HASH" >>$GITHUB_OUTPUT
echo "pypgstac-image-exists: $EXISTS"
echo "pypgstac-image-hash: $HASH"

buildpypgstacbase:
name: Build and push base pypgstac image
needs: [check-pypgstac-base]
if: ${{ needs.check-pypgstac-base.outputs.pypgstac-image-exists != 'true' }}
runs-on: ubuntu-latest
steps:
- name: Display inputs
run: |
echo "Inputs:"
echo ${{ needs.check-pypgstac-base.outputs.pypgstac-image-exists }}
echo ${{ needs.check-pypgstac-base.outputs.pypgstac-image-hash }}
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Base Postgres
uses: docker/build-push-action@v6
with:
platforms: linux/amd64
context: .
target: pypgstac-base
file: docker/pypgstac/Dockerfile
tags: ${{ env.REGISTRYPATH }}/pypgstac-base:${{ needs.check-pypgstac-base.outputs.pypgstac-image-hash }}
push: true
cache-from: type=gha
cache-to: type=gha, mode=max
wheels:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: src/pypgstac
target: x86_64
args: --release --out /home/runner/work/pgstac/pgstac/dist
sccache: 'true'
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels
path: /home/runner/work/pgstac/pgstac/dist/*
if-no-files-found: error
test:
needs: [check-pgstac-base, check-pypgstac-base, buildpg, buildpypgstacbase, wheels]
if: ${{ always() && !failure() && !cancelled() }}
runs-on: ubuntu-latest
container:
image: ghcr.io/stac-utils/pypgstac-base:${{ needs.check-pypgstac-base.outputs.pypgstac-image-hash }}
env:
PGHOST: localhost
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: postgres
volumes:
- ${{ github.workspace }}/src:/opt/src
- ${{ github.workspace }}/src:/src
services:
pg:
image: ghcr.io/stac-utils/pgstac-base:${{ needs.check-pgstac-base.outputs.pgstac-image-hash }}
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DATABASE: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

steps:
- uses: actions/checkout@v4
- name: Get Wheel
uses: actions/download-artifact@v4
with:
name: wheels
path: /tmp/wheels
- name: Install pypgstac
run: |
echo "ls /"
ls /
echo "ls /opt/"
ls /opt/
echo "ls /src/"
ls /src/
. /venv/bin/activate && echo "venv activated"
uv pip install --offline --find-links /tmp/wheels pypgstac && echo "pypgstac installed from wheel"
/scripts/test && echo "tests completed"


# linux_x86_64:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# working-directory: src/pypgstac
# target: x86_64
# args: --release --out ${{ env.GITHUB_WORKSPACE }}/dist
# sccache: 'true'
# manylinux: auto
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-x86_64
# path: ${{ env.GITHUB_WORKSPACE }}/dist/*
# if-no-files-found: error

# linux:
# if: false
# runs-on: ubuntu-latest
# strategy:
# matrix:
# target: [x86, aarch64, armv7, s390x, ppc64le]
# steps:
# - uses: actions/checkout@v4
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# working-directory: src/pypgstac
# target: ${{ matrix.target }}
# args: --release --out ${{ env.GITHUB_WORKSPACE }}/dist
# sccache: 'true'
# manylinux: auto
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: wheels-${{ matrix.target }}
# path: ${{ env.GITHUB_WORKSPACE }}/dist/*
# if-no-files-found: error

# windows:
# if: false
# runs-on: windows-latest
# strategy:
# matrix:
# target: [x64, x86]
# steps:
# - uses: actions/checkout@v4
# - name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# architecture: ${{ matrix.target }}
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# working-directory: src/pypgstac
# target: ${{ matrix.target }}
# args: --release --out ${{ env.GITHUB_WORKSPACE }}/dist
# sccache: 'true'
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: win-wheels-${{ matrix.target }}
# path: ${{ env.GITHUB_WORKSPACE }}/dist/*
# if-no-files-found: error

# macos:
# if: false
# runs-on: macos-latest
# strategy:
# matrix:
# target: [x86_64, aarch64]
# steps:
# - uses: actions/checkout@v4
# - name: Build wheels
# uses: PyO3/maturin-action@v1
# with:
# working-directory: src/pypgstac
# target: ${{ matrix.target }}
# args: --release --out /tmp/dist
# sccache: 'true'
# - name: Upload wheels
# uses: actions/upload-artifact@v4
# with:
# name: mac-wheels-${{ matrix.target }}
# path: /tmp/dist/*
# if-no-files-found: error

# sdist:
# if: false
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Build sdist
# uses: PyO3/maturin-action@v1
# with:
# working-directory: src/pypgstac
# command: sdist
# args: --out ${{ env.GITHUB_WORKSPACE }}/dist
# - name: Upload sdist
# uses: actions/upload-artifact@v4
# with:
# name: source-wheels
# path: ${{ env.GITHUB_WORKSPACE }}/dist/*
# if-no-files-found: error

#
Loading
Loading