Skip to content

Commit 6ef9e17

Browse files
authored
Merge pull request #2839 from ReactionMechanismGenerator/fix/accidental_builds
Avoid Accidental `conda` Uploads
2 parents d0d95b3 + 6d005de commit 6ef9e17

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.github/workflows/conda_build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ jobs:
4040
- name: Install Build Tools
4141
run: conda install python anaconda-client conda-build
4242

43-
- name: Configure Auto-Upload
44-
if: github.ref == 'refs/heads/stable'
45-
run: |
46-
conda config --set anaconda_upload yes
47-
4843
- name: Build Binary
4944
run: |
5045
# set a default value to the conda_token if needed (like from forks)
@@ -53,7 +48,15 @@ jobs:
5348
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
5449
conda config --add channels rmg
5550
conda config --add channels conda-forge
56-
CONDA_NPY=${{ matrix.numpy-version }} CONDA_PY=${{ matrix.python-version }} conda build --token $CONDA_TOKEN --user rmg .
51+
conda config --set anaconda_upload no
52+
CONDA_NPY=${{ matrix.numpy-version }} CONDA_PY=${{ matrix.python-version }} conda build .
53+
54+
- name: Upload Built Binaries
55+
if: >
56+
(github.event_name == 'push' && github.ref == 'refs/heads/stable') ||
57+
(github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/stable')
58+
run: |
59+
anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload $(conda build --output)
5760
5861
result:
5962
if: ${{ always() }}

0 commit comments

Comments
 (0)