@@ -3,9 +3,6 @@ on: [workflow_dispatch]
3
3
4
4
env :
5
5
PACKAGE_NAME : pymer4
6
- DEPLOY_PY_VER : 3.8 # only this job deploys docs, anaconda.org, pypi
7
- DEPLOY_OS : ubuntu-latest
8
- CONDA_BLD_PATH : /tmp/ci_conda_bld
9
6
10
7
defaults :
11
8
run :
@@ -18,82 +15,30 @@ jobs:
18
15
runs-on : ${{ matrix.os }}
19
16
strategy :
20
17
matrix :
21
- py_ver : [3.7, 3.8, 3.9]
22
- os : [ubuntu-latest, macos-11] # Intel macs
23
-
24
- outputs :
25
- # tarballs are py3X job-specific
26
- conda-tarball : ${{ steps.conda-bld.outputs.conda-tarball }}
18
+ py_ver : [3.8]
19
+ os : [ubuntu-latest]
27
20
28
21
steps :
29
-
30
22
# ------------------------------------------------------------
31
- # 0. Print some basic github action info
32
- - name : diagnostic info
33
- run : |
34
- echo "OS: ${{ matrix.os }}"
35
- echo "Python: ${{ matrix.py_ver }}"
36
- echo "Conda build path: $CONDA_BLD_PATH"
37
- echo "Deploy OS: $DEPLOY_OS"
38
- echo "Deploy Python: $DEPLOY_PY_VER"
39
- echo "GA event name: ${{ github.event_name }}"
40
- echo "GA ref: ${{ github.ref }}"
23
+ # Step up miniconda
24
+ - name : Download Miniconda
25
+ uses : conda-incubator/setup-miniconda@059455a698430d8b68fa317268fa2e3da3492a98
26
+ with :
27
+ miniconda-version : " latest"
28
+ python-version : ${{ matrix.py_ver }}
41
29
42
30
# ------------------------------------------------------------
43
- # 1. Grab git repo, setup miniconda environment and packages required to build
44
- - uses : actions/checkout@v2
45
- - name : Setup Miniconda + Checkout code
46
- run : |
47
- echo "GIT_ABBREV_COMMIT=_g${GITHUB_SHA:0:8}" >> $GITHUB_ENV
48
-
49
- if [[ ${{ runner.os }} == Linux ]]; then \
50
- miniconda_url='https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh'; \
51
- fi
52
- if [[ ${{ runner.os }} == macOS ]]; then \
53
- miniconda_url='https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh'; \
54
- fi
55
-
56
- wget $miniconda_url -O $HOME/miniconda.sh
57
- bash ~/miniconda.sh -b -p $HOME/miniconda
58
- hash -r
59
- $HOME/miniconda/bin/conda shell.bash hook >> ~/.bash_profile
60
- source ~/.bash_profile
61
-
62
- hash -r
63
- conda config --set always_yes yes --set changeps1 no
64
- conda config --set bld_path $CONDA_BLD_PATH
65
- conda install -n base -q conda-build conda-verify anaconda-client
66
- echo "# ------------------------------------------------------------"
67
- conda info -a
68
-
31
+ # Get code
32
+ - name : Checkout code
33
+ uses : actions/checkout@v2
69
34
# ------------------------------------------------------------
70
- # 2. Build the conda package and tarballs for each OS
71
- # env defined here are just for convenience when writing bash commands
72
- - name : Build package
73
- id : conda-bld
74
- env :
75
- OS : ${{ runner.os }}
76
- PY_VER : ${{ matrix.py_ver }}
35
+ - name : Build and deploy to Pypi
77
36
run : |
78
- conda build --python=$PY_VER -c conda-forge -c defaults conda
79
- tarball=$(conda build --python=$PY_VER conda --output | tail -1)
80
- if [[ $OS == "Linux" ]]; then \
81
- conda convert -p win-64 -o $CONDA_BLD_PATH $tarball; \
82
- fi
83
- echo "conda build tarball" $tarball
84
- echo "::set-output name=conda-tarball::$tarball"
85
-
86
- # 6. Build package for PyPi (only for 3.8 linux which handles deployment)
87
- - name : Build for Pypi
88
- if : ${{ matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS }}
89
- run : |
90
- conda activate env_$PY_VER
91
37
pip install build
92
38
python -m build --sdist --wheel --outdir dist/
93
-
39
+
94
40
# 7. Deploy package to Pypi (only need to do this once on linux)
95
41
- name : PyPi deploy
96
- if : ${{ matrix.py_ver == env.DEPLOY_PY_VER && matrix.os == env.DEPLOY_OS }}
97
42
uses : pypa/gh-action-pypi-publish@master
98
43
with :
99
44
password : ${{ secrets.PYPI_API_TOKEN }}
0 commit comments