Hardening publishing pipeline#16
Merged
Merged
Conversation
temporaer
approved these changes
Jun 12, 2026
temporaer
requested changes
Jun 12, 2026
Collaborator
There was a problem hiding this comment.
maybe better:
name: conda
on:
release:
types:
- published
permissions:
contents: read
jobs:
build-linux:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: molskill
environment-file: environment.yml
condarc-file: conda-recipe/.condarc
python-version: 3.9
auto-activate-base: false
- name: Build conda package
run: |
conda info
conda install conda-build anaconda-client boa --yes
boa build conda-recipe/
- name: Collect packages
run: |
mkdir -p dist-conda
find "$CONDA_PREFIX/../conda-bld" \
\( -name '*.conda' -o -name '*.tar.bz2' \) \
-type f \
-print \
-exec cp {} dist-conda/ \;
- uses: actions/upload-artifact@v4
with:
name: conda-packages-linux
path: dist-conda/*
publish:
needs: build-linux
environment: conda-release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: conda-packages-linux
path: dist-conda
- uses: conda-incubator/setup-miniconda@v3
with:
auto-activate-base: true
- name: Install uploader
run: conda install anaconda-client --yes
- name: Publish to Anaconda
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
run: |
shopt -s nullglob
for pkg in dist-conda/*.conda dist-conda/*.tar.bz2; do
anaconda -t "${ANACONDA_API_TOKEN}" upload -u msr-ai4science "${pkg}"
donethis way, if malicious code in build step infects your runtime environment, it won't be able to leak the token later.
temporaer
approved these changes
Jun 12, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rotate
CONDA_TOKENsecret, add environment guard toconda.ymlworkflow, restrict who can trigger the release workflow.