Skip to content

Commit

Permalink
Prefix release CI (#301)
Browse files Browse the repository at this point in the history
  • Loading branch information
atmorling authored Oct 22, 2024
1 parent 8cdd372 commit 828f102
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 0 deletions.
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
73 changes: 73 additions & 0 deletions publish/recipes/release/ecoscope.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
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
- atmorling

0 comments on commit 828f102

Please sign in to comment.