From ae938ec7aa25098c69b2f312485e033c31e943e4 Mon Sep 17 00:00:00 2001 From: ejolly Date: Fri, 9 Dec 2022 17:39:41 -0500 Subject: [PATCH] update GA --- .github/workflows/Build.yml | 7 +- .github/workflows/manual_upload_conda.yml | 2 +- .github/workflows/manual_upload_pypi.yml | 81 ++++------------------- 3 files changed, 15 insertions(+), 75 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 736c29a..895e4f4 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -1,4 +1,4 @@ -name: Build (& Test) +name: Build with Conda (not working) on: workflow_dispatch: inputs: @@ -6,11 +6,6 @@ on: description: 'Run workflow with ssh debugging' required: false default: false - release: - types: [published] - - schedule: - - cron: '0 0 * * 0' env: PACKAGE_NAME: pymer4 diff --git a/.github/workflows/manual_upload_conda.yml b/.github/workflows/manual_upload_conda.yml index 0f6a0a1..651865a 100644 --- a/.github/workflows/manual_upload_conda.yml +++ b/.github/workflows/manual_upload_conda.yml @@ -1,4 +1,4 @@ -name: manual release conda +name: Release with Conda (not used) on: [workflow_dispatch] env: diff --git a/.github/workflows/manual_upload_pypi.yml b/.github/workflows/manual_upload_pypi.yml index 40e3b8e..9f0ff66 100644 --- a/.github/workflows/manual_upload_pypi.yml +++ b/.github/workflows/manual_upload_pypi.yml @@ -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: @@ -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 }}