Skip to content

Commit

Permalink
fix: Upload conda package to both rapidsai & rapidsai-nightly orgs (
Browse files Browse the repository at this point in the history
  • Loading branch information
ajschmidt8 authored Apr 24, 2024
1 parent a0adbbb commit eead837
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/actions/semantic-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ inputs:
GITHUB_TOKEN:
required: true
PYPI_TOKEN: {}
ANACONDA_TOKEN: {}
ANACONDA_STABLE_TOKEN: {}
ANACONDA_NIGHTLY_TOKEN: {}
DRY_RUN:
default: "false"
outputs:
Expand All @@ -23,6 +24,7 @@ runs:
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
PYPI_TOKEN: ${{ inputs.PYPI_TOKEN }}
ANACONDA_TOKEN: ${{ inputs.ANACONDA_TOKEN }}
ANACONDA_STABLE_TOKEN: ${{ inputs.ANACONDA_STABLE_TOKEN }}
ANACONDA_NIGHTLY_TOKEN: ${{ inputs.ANACONDA_NIGHTLY_TOKEN }}
DRY_RUN: ${{ inputs.DRY_RUN }}
run: ${GITHUB_ACTION_PATH}/semantic-release.sh
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ jobs:
with:
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
PYPI_TOKEN: ${{ secrets.RAPIDSAI_PYPI_TOKEN }}
ANACONDA_TOKEN: ${{ secrets.CONDA_RAPIDSAI_TOKEN }}
ANACONDA_STABLE_TOKEN: ${{ secrets.CONDA_RAPIDSAI_TOKEN }}
ANACONDA_NIGHTLY_TOKEN: ${{ secrets.CONDA_RAPIDSAI_NIGHTLY_TOKEN }}
- name: Trigger CI Images
env:
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion .releaserc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ plugins:
- - "@semantic-release/exec"
- publishCmd: ./ci/publish/wheel.sh
- - "@semantic-release/exec"
- publishCmd: ./ci/publish/conda.sh
- publishCmd: ./ci/publish/conda.sh rapidsai
- - "@semantic-release/exec"
- publishCmd: ./ci/publish/conda.sh rapidsai-nightly
- - "@semantic-release/git"
- assets:
- src/rapids_dependency_file_generator/_version.py
Expand Down
20 changes: 18 additions & 2 deletions ci/publish/conda.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,27 @@ set -euo pipefail
conda install -y anaconda-client
pkgs_to_upload=$(find "${CONDA_OUTPUT_DIR}" -name "*.tar.bz2")

export CONDA_ORG="${1}"

case "${CONDA_ORG}" in
"rapidsai")
TOKEN="${ANACONDA_STABLE_TOKEN}"
;;
"rapidsai-nightly")
TOKEN="${ANACONDA_NIGHTLY_TOKEN}"
;;
*)
echo "Unknown conda org: ${CONDA_ORG}"
exit 1
;;
esac


anaconda \
-t "${ANACONDA_TOKEN}" \
-t "${TOKEN}" \
upload \
--no-progress \
${pkgs_to_upload}
} 1>&2

jq -ncr '{name: "Conda release", url: "https://anaconda.org/rapidsai/rapids-dependency-file-generator"}'
jq -ncr '{name: "Conda release - \(env.CONDA_ORG)", url: "https://anaconda.org/\(env.CONDA_ORG)/rapids-dependency-file-generator"}'

0 comments on commit eead837

Please sign in to comment.