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

Prefix release CI #301

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,65 @@ jobs:
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'

build-for-prefix:
name: Build prefix package
needs:
- github-release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download the built dist
uses: actions/download-artifact@v4
with:
name: pip-dist
path: dist/
- name: Add tag to recipe
run: sed -i "s/TAG_VERSION/${{ github.ref_name }}/g" publish/recipes/release/ecoscope.yaml
- name: Add dist to recipe
run: sed -i "s/DIST_NAME/$(find ./dist/*.tar.gz -printf "%f\n")/g" publish/recipes/release/ecoscope.yaml
- name: Log the generated recipe
run: cat publish/recipes/release/ecoscope.yaml
- name: Create channel
run: mkdir -p /tmp/ecoscope/release/artifacts
- name: Build prefix release
uses: prefix-dev/[email protected]
with:
recipe-path: publish/recipes/release/ecoscope.yaml
build-args: --output-dir /tmp/ecoscope/release/artifacts --channel https://prefix.dev/ecoscope-workflows --channel conda-forge
- name: Upload conda channel
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: |
/tmp/ecoscope/release/artifacts/
!/tmp/ecoscope/release/artifacts/bld
!/tmp/ecoscope/release/artifacts/src_cache
if-no-files-found: error
compression-level: 0

publish-to-prefix:
name: Publish to prefix
needs:
- build-for-prefix
runs-on: ubuntu-latest
steps:
- name: Download conda channel
uses: actions/download-artifact@v4
with:
name: release-artifacts
path: /tmp/ecoscope/release/artifacts
- name: Log conda channel contents
run: ls -lR /tmp/ecoscope/release/artifacts
- uses: actions/checkout@v4
- name: Publish to prefix.dev
uses: prefix-dev/[email protected]
- run: |
for file in /tmp/ecoscope/release/artifacts/**/*.conda; do
rattler-build upload prefix -c ecoscope-workflows "$file" || true
done
env:
PREFIX_API_KEY: ${{ secrets.PREFIX_API_KEY }}

publish-to-pypi:
name: Publish to PyPI
needs:
Expand Down
72 changes: 72 additions & 0 deletions publish/recipes/release/ecoscope.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
context:
name: ecoscope
version: TAG_VERSION

package:
name: ecoscope
version: ${{ version }}

source:
path: ../../../dist/DIST_NAME

build:
noarch: python
script: SETUPTOOLS_SCM_PRETEND_VERSION=${{ version }} pip install . -v
number: 5

requirements:
host:
- python
- setuptools >=45
- setuptools-scm >=6.2
- pip
run:
- python
- backoff
- earthengine-api
- earthranger-client
- fiona <1.10.0
- geopandas <=0.14.2
- numpy <2 # added by me, but should be ensured by geopandas anyway
- pyproj
- rasterio
- tqdm
# ~ analysis ~
- astroplan
# - datashader # (cisaacstern) per atmorling, not required for current workflows
- igraph
- mapclassify
# - matplotlib # disabling in favor of matplotlib-base which is smaller
- matplotlib-base
- networkx
- numba
- scipy
- scikit-image
- scikit-learn
# ~ plotting ~
# - kaleido # not available on conda and do we actually use this?
- plotly
# - scikit-learn # duplicate with analysis
# ~ mapping ~
- lonboard==0.0.3
# - matplotlib # duplicate with analysis
# - mapclassify # duplicate with analysis

tests:
- python:
imports:
- ecoscope
- ecoscope.analysis
- ecoscope.base
- ecoscope.io
- ecoscope.mapping
- ecoscope.plotting

about:
summary: Standard Analytical Reporting Framework for Conservation
license: BSD-3-Clause
license_file: LICENSE

extra:
recipe-maintainers:
- cisaacstern
Comment on lines +70 to +72
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@atmorling take credit here!

Loading