Skip to content

Commit

Permalink
Merge pull request #410 from tomvothecoder/hotfix/392-publish-anaconda
Browse files Browse the repository at this point in the history
Add publish to Anaconda workflow
  • Loading branch information
tomvothecoder authored Mar 19, 2021
2 parents 68f4a39 + b5cb924 commit 6f7cc4e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 48 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/publish_to_anaconda.yml
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
43 changes: 0 additions & 43 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,46 +151,3 @@ jobs:
directory: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true

publish-to-anaconda:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [pre-commit-hooks, build, publish-docs]
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
9 changes: 4 additions & 5 deletions docs/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ that makes it easy to create intelligent and beautiful documentation, written
by Georg Brandl and licensed under the BSD license.

The documentation is maintained in the ``master`` branch of the GitHub repository.
You can include code and its corresponding documentation updates in a single pull-request (PR).
You can include code and its corresponding documentation updates in a single pull request (PR).

After merging a PR, GitHub Actions automates the documentation building process.
It pushes the HTML build to the ``gh-pages`` branch, which is hosted on GitHub Pages.


Edit Documentation
-------------------------------

Expand Down Expand Up @@ -69,7 +68,7 @@ To begin editing:
# `docs/_build` is ignored by git since it does not need to be pushed
git add .
git commit "..."
git push <your-fork-remote-name> <branch-name>
git push origin <branch-name>

6. <`OPTIONAL`> If you want to generate and view versioned docs: ::

Expand All @@ -84,9 +83,9 @@ To begin editing:

Docs version selector dropdown in the bottom left-hand corner

7. Create a pull-request from ``your-fork/e3sm_diags/branch-name`` to ``E3SM-Project/e3sm_diags/master``.
7. Create a pull request from ``your-fork/e3sm_diags/branch-name`` to ``E3SM-Project/e3sm_diags/master``.

Once this pull-request is merged and GitHub Actions finishes building the docs, changes will be available on the
Once this pull request is merged and GitHub Actions finishes building the docs, changes will be available on the
`e3sm_diags documentation page <https://e3sm-project.github.io/e3sm_diags/>`_.

How Documentation is Versioned
Expand Down

0 comments on commit 6f7cc4e

Please sign in to comment.