Upload to Anaconda #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |