Skip to content

Commit 07cbb32

Browse files
Conda support (#16)
* Conda * Remove conda-forge mention * Update tag wildcard * Update .github/workflows/release-conda.yml Co-authored-by: Julien Chaumond <[email protected]>
1 parent b83b078 commit 07cbb32

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

.github/conda/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
$PYTHON setup.py install # Python command to install the script.

.github/conda/meta.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{% set name = "huggingface_hub" %}
2+
3+
package:
4+
name: "{{ name|lower }}"
5+
version: "{{ HUB_VERSION }}"
6+
7+
source:
8+
path: ../../
9+
10+
build:
11+
noarch: python
12+
13+
requirements:
14+
host:
15+
- python
16+
- pip
17+
- filelock
18+
- requests
19+
- tqdm
20+
run:
21+
- python
22+
- pip
23+
- filelock
24+
- requests
25+
- tqdm
26+
27+
test:
28+
imports:
29+
- huggingface_hub
30+
31+
about:
32+
home: https://huggingface.co
33+
license: Apache License 2.0
34+
license_file: LICENSE
35+
summary: "Client library to download and publish models and other files on the huggingface.co hub"
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release Conda
2+
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- conda_*
9+
10+
env:
11+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
12+
13+
jobs:
14+
build_and_package:
15+
runs-on: ubuntu-latest
16+
defaults:
17+
run:
18+
shell: bash -l {0}
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v1
23+
24+
- name: Install miniconda
25+
uses: conda-incubator/setup-miniconda@v2
26+
with:
27+
auto-update-conda: true
28+
auto-activate-base: false
29+
activate-environment: "build-hub"
30+
31+
- name: Setup conda env
32+
run: |
33+
conda install -c defaults anaconda-client conda-build
34+
35+
- name: Extract version
36+
run: echo "HUB_VERSION=`python setup.py --version`" >> $GITHUB_ENV
37+
38+
- name: Build conda packages
39+
run: |
40+
conda info
41+
conda-build .github/conda
42+
43+
- name: Upload to Anaconda
44+
run: |
45+
anaconda upload `conda-build .github/conda --output` --force

0 commit comments

Comments
 (0)