Skip to content

Commit 4b84816

Browse files
committed
Build and release self to conda.
1 parent b51edd8 commit 4b84816

File tree

12 files changed

+172
-11
lines changed

12 files changed

+172
-11
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 2020.12.15.1
2+
current_version = 2020.12.15
33
commit = True
44
tag = True
55

.github/actions_build_conda.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
# This file is managed by 'repo_helper'. Don't edit it directly.
3+
4+
set -e -x
5+
6+
python -m repo_helper make-recipe || exit 1
7+
8+
# Switch to miniconda
9+
source "/home/runner/miniconda/etc/profile.d/conda.sh"
10+
hash -r
11+
conda activate base
12+
conda config --set always_yes yes --set changeps1 no
13+
conda update -q conda
14+
conda install conda-build
15+
conda install anaconda-client
16+
conda info -a
17+
18+
conda config --add channels conda-forge || exit 1
19+
conda config --add channels domdfcoding || exit 1
20+
21+
conda build conda -c conda-forge -c domdfcoding --output-folder conda/dist --skip-existing --numpy 1.16
22+
23+
exit 0

.github/actions_deploy_conda.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
# This file is managed by 'repo_helper'. Don't edit it directly.
3+
4+
set -e -x
5+
6+
# Switch to miniconda
7+
source "/home/runner/miniconda/etc/profile.d/conda.sh"
8+
hash -r
9+
conda activate base
10+
conda config --set always_yes yes --set changeps1 no
11+
conda update -q conda
12+
conda install anaconda-client
13+
conda info -a
14+
15+
for f in conda/dist/noarch/repo_helper-*.tar.bz2; do
16+
[ -e "$f" ] || continue
17+
echo "$f"
18+
conda install "$f" || exit 1
19+
echo "Deploying to Anaconda.org..."
20+
anaconda -t "$ANACONDA_TOKEN" upload "$f" || exit 1
21+
echo "Successfully deployed to Anaconda.org."
22+
done
23+
24+
exit 0

.github/workflows/conda_ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This file is managed by 'repo_helper'. Don't edit it directly.
2+
---
3+
name: Conda Tests
4+
5+
on:
6+
push:
7+
pull_request:
8+
branches: ["master"]
9+
10+
jobs:
11+
tests:
12+
name: "Conda"
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout 🛎️
17+
uses: "actions/checkout@v2"
18+
19+
- name: Setup Python 🐍
20+
uses: "actions/setup-python@v2"
21+
with:
22+
python-version: "3.8"
23+
24+
- name: Install dependencies 🔧
25+
run: |
26+
python -VV
27+
python -m site
28+
python -m pip install --upgrade pip setuptools wheel
29+
python -m pip install --upgrade repo_helper
30+
# $CONDA is an environment variable pointing to the root of the miniconda directory
31+
$CONDA/bin/conda update -q conda
32+
$CONDA/bin/conda install conda-build
33+
34+
$CONDA/bin/conda config --add channels conda-forge
35+
$CONDA/bin/conda config --add channels domdfcoding
36+
37+
- name: "Build and install package"
38+
run: |
39+
# This mess is only necessary because conda won't fix it themselves
40+
# https://github.com/conda/conda/issues/1884
41+
42+
python -m repo_helper build --conda --out-dir conda-bld/noarch
43+
$CONDA/bin/conda index ./conda-bld || exit 1
44+
$CONDA/bin/conda install -c file://$(pwd)/conda-bld repo_helper -y || exit 1

.github/workflows/python_ci_linux.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,38 @@ jobs:
126126
user: __token__
127127
password: ${{ secrets.PYPI_TOKEN }}
128128
skip_existing: true
129+
130+
131+
132+
Conda:
133+
needs: deploy
134+
runs-on: "ubuntu-20.04"
135+
if: startsWith(github.ref, 'refs/tags/') || ${{ startsWith(github.event.head_commit.message, 'Bump version') != true }}
136+
steps:
137+
- name: Checkout 🛎️
138+
uses: "actions/checkout@v2"
139+
140+
- name: Setup Python 🐍
141+
uses: "actions/setup-python@v2"
142+
with:
143+
python-version: 3.8
144+
145+
- name: Install dependencies 🔧
146+
run: |
147+
python -m pip install --upgrade pip setuptools wheel
148+
python -m pip install --upgrade repo_helper
149+
150+
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
151+
bash miniconda.sh -b -p $HOME/miniconda
152+
153+
- name: Build Conda 📦
154+
run: |
155+
chmod +x .github/actions_build_conda.sh
156+
bash .github/actions_build_conda.sh
157+
158+
- name: Deploy Conda 🚀
159+
run: |
160+
chmod +x .github/actions_deploy_conda.sh
161+
bash .github/actions_deploy_conda.sh
162+
env:
163+
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}

README.rst

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Note: The autocommit functionality is currently broken on Windows, but works OK
2424
- |actions_linux| |actions_windows| |actions_macos| |coveralls| |codefactor| |pre_commit_ci|
2525
* - PyPI
2626
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
27+
* - Anaconda
28+
- |conda-version| |conda-platform|
2729
* - Activity
2830
- |commits-latest| |commits-since| |maintained|
2931
* - Other
@@ -77,14 +79,22 @@ Note: The autocommit functionality is currently broken on Windows, but works OK
7779
:target: https://pypi.org/project/repo_helper/
7880
:alt: PyPI - Wheel
7981

82+
.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/repo_helper?logo=anaconda
83+
:target: https://anaconda.org/domdfcoding/repo_helper
84+
:alt: Conda - Package Version
85+
86+
.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/repo_helper?label=conda%7Cplatform
87+
:target: https://anaconda.org/domdfcoding/repo_helper
88+
:alt: Conda - Platform
89+
8090
.. |license| image:: https://img.shields.io/github/license/domdfcoding/repo_helper
8191
:target: https://github.com/domdfcoding/repo_helper/blob/master/LICENSE
8292
:alt: License
8393

8494
.. |language| image:: https://img.shields.io/github/languages/top/domdfcoding/repo_helper
8595
:alt: GitHub top language
8696

87-
.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/repo_helper/v2020.12.15.1
97+
.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/repo_helper/v2020.12.15
8898
:target: https://github.com/domdfcoding/repo_helper/pulse
8999
:alt: GitHub commits since tagged version
90100

@@ -110,12 +120,27 @@ Installation
110120

111121
.. start installation
112122
113-
``repo_helper`` can be installed from PyPI.
123+
``repo_helper`` can be installed from PyPI or Anaconda.
114124

115125
To install with ``pip``:
116126

117127
.. code-block:: bash
118128
119129
$ python -m pip install repo_helper
120130
131+
To install with ``conda``:
132+
133+
* First add the required channels
134+
135+
.. code-block:: bash
136+
137+
$ conda config --add channels http://conda.anaconda.org/conda-forge
138+
$ conda config --add channels http://conda.anaconda.org/domdfcoding
139+
140+
* Then install
141+
142+
.. code-block:: bash
143+
144+
$ conda install repo_helper
145+
121146
.. end installation

__pkginfo__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
2020 Dominic Davis-Foster <[email protected]>
2727
"""
2828

29-
__version__ = "2020.12.15.1"
29+
__version__ = "2020.12.15"
3030

3131
repo_root = pathlib.Path(__file__).parent
3232
install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')

doc-source/index.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ This project is in an early stage, and some things might not work correctly or b
2424
- |actions_linux| |actions_windows| |actions_macos| |coveralls| |codefactor| |pre_commit_ci|
2525
* - PyPI
2626
- |pypi-version| |supported-versions| |supported-implementations| |wheel|
27+
* - Anaconda
28+
- |conda-version| |conda-platform|
2729
* - Activity
2830
- |commits-latest| |commits-since| |maintained|
2931
* - Other
@@ -78,6 +80,14 @@ This project is in an early stage, and some things might not work correctly or b
7880
:wheel:
7981
:alt: PyPI - Wheel
8082

83+
.. |conda-version| image:: https://img.shields.io/conda/v/domdfcoding/repo_helper?logo=anaconda
84+
:target: https://anaconda.org/domdfcoding/repo_helper
85+
:alt: Conda - Package Version
86+
87+
.. |conda-platform| image:: https://img.shields.io/conda/pn/domdfcoding/repo_helper?label=conda%7Cplatform
88+
:target: https://anaconda.org/domdfcoding/repo_helper
89+
:alt: Conda - Platform
90+
8191
.. |license| github-shield::
8292
:license:
8393
:alt: License
@@ -87,7 +97,7 @@ This project is in an early stage, and some things might not work correctly or b
8797
:alt: GitHub top language
8898

8999
.. |commits-since| github-shield::
90-
:commits-since: v2020.12.15.1
100+
:commits-since: v2020.12.15
91101
:alt: GitHub commits since tagged version
92102

93103
.. |commits-latest| github-shield::
@@ -114,6 +124,8 @@ Installation
114124
.. installation:: repo_helper
115125
:pypi:
116126
:github:
127+
:anaconda:
128+
:conda-channels: conda-forge, domdfcoding
117129

118130
.. end installation
119131

repo_helper.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ modname: repo_helper
33
copyright_years: "2020"
44
author: "Dominic Davis-Foster"
55
6-
version: "2020.12.15.1"
6+
version: "2020.12.15"
77
username: "domdfcoding"
88
license: 'LGPLv3+'
99
short_desc: 'A tool to manage configuration files, build scripts etc. across multiple projects.'
1010
docs_url: https://docs.repo-helper.uk
1111

12-
enable_conda: false
13-
1412
additional_ignore:
1513
- Tokens
1614
- rh.bat

repo_helper/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@
2626
__author__: str = "Dominic Davis-Foster"
2727
__copyright__: str = "2020 Dominic Davis-Foster"
2828
__license__: str = "LGPLv3+"
29-
__version__: str = "2020.12.15.1"
29+
__version__: str = "2020.12.15"
3030
__email__: str = "[email protected]"

0 commit comments

Comments
 (0)