-
Notifications
You must be signed in to change notification settings - Fork 383
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #410 from tomvothecoder/hotfix/392-publish-anaconda
Add publish to Anaconda workflow
- Loading branch information
Showing
3 changed files
with
51 additions
and
48 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Publish to Anaconda | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish-to-anaconda: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache Conda | ||
uses: actions/cache@v2 | ||
env: | ||
# Increase this value to reset cache if conda/e3sm_diags_env_dev.yml has not changed in the workflow | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-publish | ||
|
||
- name: Set up Conda Environment | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
activate-environment: "e3sm_diags_publishing" | ||
channel-priority: strict | ||
python-version: 3.7 | ||
auto-update-conda: true | ||
# IMPORTANT: This needs to be set for caching to work properly! | ||
use-only-tar-bz2: true | ||
|
||
- name: Additional Conda Config | ||
run: | | ||
conda install anaconda-client conda-build conda-verify | ||
conda config --set anaconda_upload no | ||
- name: Build Conda Package | ||
run: conda build -c conda-forge --output-folder . . | ||
|
||
- name: Publish to Anaconda | ||
env: | ||
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | ||
run: anaconda upload --label main noarch/*.tar.bz2 --force |
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
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