Various Documentation Fixes (#991) #50
Workflow file for this run
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
# Tethys Main CI | |
name: Tethys-CI | |
# Only run on tags. | |
on: | |
push: | |
tags: | |
- "*" | |
env: | |
CONDA_BUILD_PIN_LEVEL: minor | |
jobs: | |
docker-build: | |
name: Docker Build (${{ matrix.platform }}) | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest] | |
python-version: [3.10] | |
steps: | |
# Checkout the source | |
- name: Checkout Source | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# Parse version parts from tag | |
- name: Parse version from tag | |
id: version | |
uses: release-kit/semver@v1 | |
- name: Safe Tag | |
id: safetag | |
run: | | |
full_tag="${{ steps.version.outputs.full }}"; | |
# no "+" characters allowed in Docker tags | |
safe_tag="${full_tag//+/-}"; | |
echo "safetag=$safe_tag" >> $GITHUB_OUTPUT; | |
echo $safe_tag; | |
- name: Log version | |
id: logversion | |
run: | | |
full_tag="${{ steps.version.outputs.full }}"; | |
# no "+" characters allowed in Docker tags | |
safe_tag="${full_tag//+/-}"; | |
echo "safetag=$safe_tag" >> $GITHUB_OUTPUT; | |
echo "Major: ${{ steps.version.outputs.major }}" | |
echo "Minor: ${{ steps.version.outputs.minor }}" | |
echo "Patch: ${{ steps.version.outputs.patch }}" | |
echo "Prerelease: ${{ steps.version.outputs.prerelease }}" | |
echo "Build: ${{ steps.version.outputs.build }}" | |
echo "Full: ${{ steps.version.outputs.full }}" | |
echo "Tag: ${{ steps.version.outputs.tag }}" | |
echo "Safe Tag: ${{ steps.safetag.outputs.safetag }}" | |
# Build the docker with version tag | |
- name: Build With Tag | |
run: | | |
full_tag="${{ steps.version.outputs.full }}"; | |
# no "+" characters allowed in Docker tags | |
safe_tag="${full_tag//+/-}"; | |
docker build -t ${{ secrets.DOCKER_UPLOAD_URL }}:"${{ steps.safetag.outputs.safetag }}" .; | |
# Authenticate docker | |
- name: Authenticate Docker | |
run: | | |
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin; | |
# Upload docker | |
- name: Upload Docker With Tag | |
run: | | |
echo "Pushing to docker registry"; | |
docker push ${{ secrets.DOCKER_UPLOAD_URL }}:${{ steps.safetag.outputs.safetag }}; | |
- name: Upload Docker With Latest Tag | |
if: ${{ steps.version.outputs.prerelease == '' }} | |
run: | | |
echo "Updating latest on the docker registry"; | |
docker tag ${{ secrets.DOCKER_UPLOAD_URL }}:${{ steps.safetag.outputs.safetag }} ${{ secrets.DOCKER_UPLOAD_URL }}:latest; | |
docker push ${{ secrets.DOCKER_UPLOAD_URL }}:latest; | |
conda-build: | |
name: Conda Build (${{ matrix.platform }}) | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [ubuntu-latest] | |
python-version: [3.10] | |
steps: | |
# Checkout the source | |
- name: Checkout Source | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
# Parse version parts from tag | |
- name: Parse version from tag | |
id: version | |
uses: release-kit/semver@v1 | |
- name: Safe Tag | |
id: safetag | |
run: | | |
full_tag="${{ steps.version.outputs.full }}"; | |
# no "+" characters allowed in Docker tags | |
safe_tag="${full_tag//+/-}"; | |
echo "safetag=$safe_tag" >> $GITHUB_OUTPUT; | |
echo $safe_tag; | |
- name: Log version | |
id: logversion | |
run: | | |
full_tag="${{ steps.version.outputs.full }}"; | |
# no "+" characters allowed in Docker tags | |
safe_tag="${full_tag//+/-}"; | |
echo "safetag=$safe_tag" >> $GITHUB_OUTPUT; | |
echo "Major: ${{ steps.version.outputs.major }}" | |
echo "Minor: ${{ steps.version.outputs.minor }}" | |
echo "Patch: ${{ steps.version.outputs.patch }}" | |
echo "Prerelease: ${{ steps.version.outputs.prerelease }}" | |
echo "Build: ${{ steps.version.outputs.build }}" | |
echo "Full: ${{ steps.version.outputs.full }}" | |
echo "Tag: ${{ steps.version.outputs.tag }}" | |
echo "Safe Tag: ${{ steps.safetag.outputs.safetag }}" | |
# Setup Tethys | |
- name: Setup Tethys | |
run: | | |
cd .. | |
bash ./tethys/scripts/install_tethys.sh --partial-tethys-install me -n tethys -s $PWD/tethys | |
. ~/miniconda/etc/profile.d/conda.sh | |
conda activate tethys | |
hash -r | |
conda config --set always_yes yes --set changeps1 no | |
conda update -q conda | |
conda install conda-build anaconda-client | |
conda config --set anaconda_upload no | |
mkdir -p ~/conda-bld | |
# Export Conda Build Path | |
- name: Set Conda Build Path | |
uses: allenevans/[email protected] | |
with: | |
CONDA_BLD_PATH: "/home/runner/conda-bld" | |
# Generate Conda Recipe With Constrained Dependencies | |
- name: Generate Conda Recipe | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda activate tethys; | |
tethys gen metayaml -p minor --overwrite; | |
# Show Tethys Meta | |
- name: Show Tethys Meta | |
run: | | |
cd .. | |
cat ./tethys/conda.recipe/meta.yaml | |
# Build Conda | |
- name: Build Conda | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda create -y -c conda-forge -n conda-build conda-build anaconda-client | |
conda activate conda-build | |
conda config --set anaconda_upload no | |
mkdir -p ~/conda-bld | |
conda-build -c tethysplatform -c conda-forge ./tethys/conda.recipe | |
# Upload to Anaconda Cloud | |
- name: Upload to Conda Release Channel | |
if: ${{ steps.version.outputs.prerelease == '' }} | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda activate tethys; | |
echo "Publishing to release channel..."; | |
anaconda -t "${{ secrets.CONDA_UPLOAD_TOKEN }}" upload -u ${{ secrets.CONDA_UPLOAD_USER }} $CONDA_BLD_PATH/noarch/tethys-platform*.tar.bz2 --force; | |
- name: Upload to Conda Dev Channel | |
if: ${{ steps.version.outputs.prerelease != '' }} | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda activate tethys; | |
echo "Publishing to dev channel..."; | |
anaconda -t "${{ secrets.CONDA_UPLOAD_TOKEN }}" upload -u ${{ secrets.CONDA_UPLOAD_USER }} -l dev $CONDA_BLD_PATH/noarch/tethys-platform*.tar.bz2 --force; | |
# BUILD micro-tethys-platform | |
# Generate Conda Recipe With Constrained Dependencies | |
- name: Generate Conda Recipe - micro | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda activate tethys; | |
tethys gen metayaml -p minor --micro --overwrite; | |
# Show Tethys Meta | |
- name: Show Tethys Meta - micro | |
run: | | |
cd .. | |
cat ./tethys/conda.recipe/meta.yaml | |
# Build Conda | |
- name: Build Conda - micro | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda create -y -c conda-forge -n conda-build conda-build anaconda-client | |
conda activate conda-build | |
conda config --set anaconda_upload no | |
mkdir -p ~/conda-bld | |
conda-build -c tethysplatform -c conda-forge ./tethys/conda.recipe | |
# Upload to Anaconda Cloud | |
- name: Upload to Conda Release Channel - micro | |
if: ${{ steps.version.outputs.prerelease == '' }} | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda activate tethys; | |
echo "Publishing to release channel..."; | |
anaconda -t "${{ secrets.CONDA_UPLOAD_TOKEN }}" upload -u ${{ secrets.CONDA_UPLOAD_USER }} $CONDA_BLD_PATH/noarch/micro-tethys-platform*.tar.bz2 --force; | |
- name: Upload to Conda Dev Channel - micro | |
if: ${{ steps.version.outputs.prerelease != '' }} | |
run: | | |
cd .. | |
. ~/miniconda/etc/profile.d/conda.sh; | |
conda activate tethys; | |
echo "Publishing to dev channel..."; | |
anaconda -t "${{ secrets.CONDA_UPLOAD_TOKEN }}" upload -u ${{ secrets.CONDA_UPLOAD_USER }} -l dev $CONDA_BLD_PATH/noarch/micro-tethys-platform*.tar.bz2 --force; |