Skip to content

Commit 8c11288

Browse files
- Add cd workflow with pip & conda deploy, etc.
- Setup environment.yml and meta.yml for conda deploy.
1 parent aa468af commit 8c11288

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed

.conda/environment.yml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
channels:
2+
- conda-forge
3+
- accessnri
4+
- default
5+
6+
dependencies:
7+
- anaconda-client
8+
- conda-build
9+
- conda-verify

.conda/meta.yaml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{% set data = load_setup_py_data(setup_file='../setup.py', from_recipe_dir=True) %}
2+
{% set version = data.get('version') %}
3+
4+
package:
5+
name: access-py-telemetry
6+
version: "{{ version }}"
7+
8+
source:
9+
url: "https://pypi.io/packages/source/a/access-py-telemetry/access_py_telemetry-{{ version }}.tar.gz"
10+
11+
build:
12+
noarch: python
13+
number: 0
14+
script: "{{ PYTHON }} -m pip install . -vv"
15+
16+
requirements:
17+
host:
18+
- python
19+
- pip
20+
- versioneer
21+
run:
22+
- python >=3.10
23+
- ipython>=7.0.0
24+
- pydantic>=2.0.0
25+
- pyyaml>=6.0.0
26+
- httpx>=0.28.0
27+
28+
about:
29+
home: https://github.com/ACCESS-NRI/access-py-telemetry
30+
license: Apache Software
31+
license_family: APACHE
32+
summary: "Tools to add telemetry data to Python package usage"
33+
# doc_url: https://access-py-telemetry-catalog.readthedocs.io/en/latest/
34+
35+
extra:
36+
recipe-maintainers:
37+
- charles-turner-1

.github/workflows/cd.yml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CD
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
pypi:
7+
name: build and deploy to PyPI
8+
if: github.repository == 'ACCESS-NRI/access-py-telemetry' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
9+
runs-on: "ubuntu-latest"
10+
permissions:
11+
id-token: write
12+
13+
steps:
14+
- name: Checkout source
15+
uses: actions/[email protected]
16+
17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.11
21+
22+
- name: Install build dependencies
23+
run: python -m pip install build twine
24+
25+
- name: Build distributions
26+
shell: bash -l {0}
27+
run: |
28+
git clean -xdf
29+
pyproject-build
30+
31+
- name: Publish package to PyPI
32+
uses: pypa/gh-action-pypi-publish@release/v1
33+
34+
conda:
35+
name: build and deploy to conda
36+
needs: pypi
37+
if: always() && needs.pypi.result == 'success'
38+
runs-on: "ubuntu-latest"
39+
40+
steps:
41+
- name: Checkout source
42+
uses: actions/[email protected]
43+
44+
- name: Setup conda environment
45+
uses: conda-incubator/setup-miniconda@v3
46+
with:
47+
miniconda-version: "latest"
48+
python-version: 3.11
49+
environment-file: .conda/environment.yml
50+
auto-update-conda: false
51+
auto-activate-base: false
52+
show-channel-urls: true
53+
54+
- name: Build and upload the conda package
55+
uses: uibcdf/[email protected]
56+
with:
57+
meta_yaml_dir: .conda
58+
python-version: 3.11
59+
user: accessnri
60+
label: main
61+
token: ${{ secrets.anaconda_token }}
62+

0 commit comments

Comments
 (0)