Skip to content

Commit

Permalink
build conda dist from PyPI dist
Browse files Browse the repository at this point in the history
  • Loading branch information
dougiesquire committed Jan 17, 2024
1 parent d47c473 commit e2d2419
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2,331 deletions.
59 changes: 30 additions & 29 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,6 @@ name: CD
on: [push, pull_request]

jobs:
conda:
name: build and deploy to conda
if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: 3.11
environment-file: conda/environment.yml
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true

- name: Build and upload the conda package
uses: uibcdf/[email protected]
with:
meta_yaml_dir: conda
python-version: 3.11
user: accessnri
label: main
token: ${{ secrets.anaconda_token }}

pypi-build:
name: Build package for PyPI
if: github.repository == 'payu-org/payu' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
Expand Down Expand Up @@ -69,3 +40,33 @@ jobs:
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
with:
packages_dir: artifact/

conda:
name: build and deploy to conda
needs: pypi-publish
if: always() && needs.pypi-publish.result == 'success'
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Setup conda environment
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
python-version: 3.11
environment-file: conda/environment.yml
auto-update-conda: false
auto-activate-base: false
show-channel-urls: true

- name: Build and upload the conda package
uses: uibcdf/[email protected]
with:
meta_yaml_dir: conda
python-version: 3.11
user: accessnri
label: main
token: ${{ secrets.anaconda_token }}
43 changes: 18 additions & 25 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,42 +1,32 @@
{% set data = load_setup_py_data(setup_file='../setup.py') %}
{% set version = data.get('version') %}

package:
name: payu
version: {{ GIT_DESCRIBE_TAG }}
version: "{{ version }}"

build:
noarch: python
number: {{ GIT_DESCRIBE_NUMBER }}
script: "{{ PYTHON }} -m pip install . --no-deps"
entry_points:
- payu = payu.cli:parse
- payu-run = payu.subcommands.run_cmd:runscript
- payu-collate = payu.subcommands.collate_cmd:runscript
- payu-profile = payu.subcommands.profile_cmd:runscript
- payu-sync = payu.subcommands.sync_cmd:runscript
- payu-branch = payu.subcommands.branch_cmd:runscript
- payu-clone = payu.subcommands.clone_cmd:runscript
- payu-checkout = payu.subcommands.checkout_cmd:runscript
number: 0
script: "{{ PYTHON }} -m pip install . -vv"

source:
git_url: ../
url: "https://pypi.io/packages/source/p/payu/payu-{{ version }}.tar.gz"

requirements:
build:
- python <=3.11
- pbr
- setuptools
host:
- python
- pip
- versioneer
run:
- python <=3.11
- python >=3.9
- f90nml >=0.16
- yamanifest >=0.3.4
- PyYAML
- requests[security]
- python-dateutil
- tenacity
- requests
- tenacity!=7.0.0
- cftime
# The following two requirements are from the security
# extra for the pypi package
- pyOpenSSL >=0.14
- cryptography>=1.3.4
- GitPython >=3.1.40
- ruamel.yaml >=0.18.5

Expand All @@ -46,6 +36,9 @@ test:
commands:
- payu list


about:
home: https://github.com/payu-org/payu/
license: Apache Software
license_family: APACHE
summary: "A climate model workflow manager for supercomputing environments"
doc_url: https://payu.readthedocs.io/en/latest/
Loading

0 comments on commit e2d2419

Please sign in to comment.