Skip to content

Commit

Permalink
update GA
Browse files Browse the repository at this point in the history
  • Loading branch information
ejolly committed Dec 9, 2022
1 parent 3898649 commit ae938ec
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 75 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
name: Build (& Test)
name: Build with Conda (not working)
on:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run workflow with ssh debugging'
required: false
default: false
release:
types: [published]

schedule:
- cron: '0 0 * * 0'

env:
PACKAGE_NAME: pymer4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual_upload_conda.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: manual release conda
name: Release with Conda (not used)
on: [workflow_dispatch]

env:
Expand Down
81 changes: 13 additions & 68 deletions .github/workflows/manual_upload_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on: [workflow_dispatch]

env:
PACKAGE_NAME: pymer4
DEPLOY_PY_VER: 3.8 # only this job deploys docs, anaconda.org, pypi
DEPLOY_OS: ubuntu-latest
CONDA_BLD_PATH: /tmp/ci_conda_bld

defaults:
run:
Expand All @@ -18,82 +15,30 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
py_ver: [3.7, 3.8, 3.9]
os: [ubuntu-latest, macos-11] # Intel macs

outputs:
# tarballs are py3X job-specific
conda-tarball: ${{ steps.conda-bld.outputs.conda-tarball }}
py_ver: [3.8]
os: [ubuntu-latest]

steps:

# ------------------------------------------------------------
# 0. Print some basic github action info
- name: diagnostic info
run: |
echo "OS: ${{ matrix.os }}"
echo "Python: ${{ matrix.py_ver }}"
echo "Conda build path: $CONDA_BLD_PATH"
echo "Deploy OS: $DEPLOY_OS"
echo "Deploy Python: $DEPLOY_PY_VER"
echo "GA event name: ${{ github.event_name }}"
echo "GA ref: ${{ github.ref }}"
# Step up miniconda
- name: Download Miniconda
uses: conda-incubator/setup-miniconda@059455a698430d8b68fa317268fa2e3da3492a98
with:
miniconda-version: "latest"
python-version: ${{ matrix.py_ver }}

# ------------------------------------------------------------
# 1. Grab git repo, setup miniconda environment and packages required to build
- uses: actions/checkout@v2
- name: Setup Miniconda + Checkout code
run: |
echo "GIT_ABBREV_COMMIT=_g${GITHUB_SHA:0:8}" >> $GITHUB_ENV
if [[ ${{ runner.os }} == Linux ]]; then \
miniconda_url='https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh'; \
fi
if [[ ${{ runner.os }} == macOS ]]; then \
miniconda_url='https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh'; \
fi
wget $miniconda_url -O $HOME/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
hash -r
$HOME/miniconda/bin/conda shell.bash hook >> ~/.bash_profile
source ~/.bash_profile
hash -r
conda config --set always_yes yes --set changeps1 no
conda config --set bld_path $CONDA_BLD_PATH
conda install -n base -q conda-build conda-verify anaconda-client
echo "# ------------------------------------------------------------"
conda info -a
# Get code
- name: Checkout code
uses: actions/checkout@v2
# ------------------------------------------------------------
# 2. Build the conda package and tarballs for each OS
# env defined here are just for convenience when writing bash commands
- name: Build package
id: conda-bld
env:
OS: ${{ runner.os }}
PY_VER: ${{ matrix.py_ver }}
- name: Build and deploy to Pypi
run: |
conda build --python=$PY_VER -c conda-forge -c defaults conda
tarball=$(conda build --python=$PY_VER conda --output | tail -1)
if [[ $OS == "Linux" ]]; then \
conda convert -p win-64 -o $CONDA_BLD_PATH $tarball; \
fi
echo "conda build tarball" $tarball
echo "::set-output name=conda-tarball::$tarball"
# 6. Build package for PyPi (only for 3.8 linux which handles deployment)
- name: Build for Pypi
if: ${{ matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS }}
run: |
conda activate env_$PY_VER
pip install build
python -m build --sdist --wheel --outdir dist/
# 7. Deploy package to Pypi (only need to do this once on linux)
- name: PyPi deploy
if: ${{ matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS }}
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit ae938ec

Please sign in to comment.