-
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 1.9 KB
/
conda_upload_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Upload to Anaconda
on:
release:
types: [created]
jobs:
upload_to_anaconda:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ 'linux-64', 'win-64' ]
python: [ '3.8', '3.9', '3.10' ]
defaults:
run:
shell: bash -l {0}
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
steps:
# Setup miniconda3
- name: Setup miniconda3
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
auto-update-conda: true
activate-environment: upload
- name: configure upload conda environment
run: |
conda create -n upload python=${{ matrix.python }}
conda install -y -n upload anaconda-client
- name: conda info
run: |
conda info
conda list
# Download the corresponding artifact based on the matrix OS
- name: Download artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: conda_test.yml
name: build-${{ matrix.os }}-${{ matrix.python }}
# Install anaconda-client if not available in the test environment
- name: Install Anaconda client
run: conda install -y -n upload anaconda-client
# Ensure version consistency between the GitHub release and the conda package
# - name: Check version consistency
# run: |
# conda activate test
# RELEASE_VERSION=${{ github.event.release.tag_name }}
# PACKAGE_VERSION=$(conda inspect --extracted-info ./artifact/*.tar.bz2 | grep version)
# if [[ "$RELEASE_VERSION" != "$PACKAGE_VERSION" ]]; then
# echo "Error: Version mismatch between GitHub release and conda package."
# exit 1
# fi
# Uploading to Anaconda
- name: Upload to Anaconda
run: |
conda activate upload
anaconda upload *.tar.bz2