Skip to content

Commit fbf5c79

Browse files
committed
adding/updating pypi/conda/docs build actions
1 parent 5266963 commit fbf5c79

File tree

3 files changed

+86
-55
lines changed

3 files changed

+86
-55
lines changed

.github/workflows/conda.yml

+34-38
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,54 @@
1-
name: publish_conda
2-
1+
name: "🐍 Build and upload Conda packages"
32
on:
4-
release:
5-
types: [edited, created]
3+
workflow_dispatch:
64
jobs:
75
conda-deploy:
8-
name: Uploading to Loop3d for python ${{ matrix.os }})
9-
runs-on: ${{ matrix.os }}
6+
name: Building conda package for python ${{ matrix.os }})
7+
runs-on: ubuntu-latest
108
strategy:
119
fail-fast: false
1210
matrix:
13-
os: ["ubuntu-latest", "windows-latest","macos-latest"]
14-
python-version: ["3.9","3.8","3.7"]
11+
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
1512
steps:
16-
- uses: conda-incubator/setup-miniconda@v2
13+
- uses: conda-incubator/setup-miniconda@v3
1714
with:
1815
auto-update-conda: true
1916
python-version: ${{ matrix.python-version }}
20-
21-
- uses: actions/checkout@v2
17+
- uses: actions/checkout@v4
2218
- name: update submodules
23-
# shell: bash -l {0}
2419
run: |
25-
git submodule update --init --recursive
26-
- name: Add msbuild to PATH
27-
if: matrix.os == 'windows-latest'
28-
uses: microsoft/[email protected]
29-
- name: Conda build'
20+
git submodule update --init --recursive
21+
- name: Conda build
3022
env:
3123
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
3224
shell: bash -l {0}
3325
run: |
34-
conda install -c conda-forge conda-build scikit-build numpy=1.20 cython anaconda-client -y
35-
conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda
36-
conda install anaconda-client -y
37-
- name: upload windows
38-
env:
39-
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
40-
if: matrix.os == 'windows-latest'
41-
shell: bash -l {0}
42-
run: |
43-
anaconda upload --label main conda/win-64/*.tar.bz2
44-
- name: upload linux
45-
env:
46-
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
47-
if: matrix.os == 'ubuntu-latest'
26+
conda install -c conda-forge conda-build scikit-build numpy cython anaconda-client conda-libmamba-solver -y
27+
conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{matrix.python-version}}
28+
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda
29+
- name: upload artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: conda-build-${{ matrix.python-version }}
33+
path: conda
34+
upload_to_conda:
35+
runs-on: ubuntu-latest
36+
needs: conda-deploy
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
41+
steps:
42+
- uses: actions/download-artifact@v4
43+
with:
44+
name: conda-build-${{ matrix.python-version }}
45+
path: conda
46+
- uses: conda-incubator/setup-miniconda@v3
47+
- name: upload all files to conda-forge
4848
shell: bash -l {0}
49-
run: |
50-
anaconda upload --label main conda/linux-64/*.tar.bz2
51-
- name: upload macosx
5249
env:
5350
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
54-
if: matrix.os == 'macos-latest'
55-
shell: bash -l {0}
5651
run: |
57-
anaconda upload --label main conda/osx-64/*.tar.bz2
58-
52+
conda install -c anaconda anaconda-client -y
53+
anaconda upload --label main conda/*/*.tar.bz2
54+

.github/workflows/documentation.yml

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
name: Build documentation and deploy
22

33
on:
4-
push:
4+
workflow_dispatch:
55

66
jobs:
77
documentation:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v2
11-
- uses: conda-incubator/[email protected]
10+
- uses: actions/checkout@v4
11+
- run: |
12+
cp CHANGELOG.md docs/source/getting_started/CHANGELOG.md
13+
docker build . -t=lsdocs -f docs/Dockerfile
14+
docker run -v $(pwd):/LoopStructural lsdocs bash LoopStructural/docs/build_docs.sh
15+
- name: upload artifacts
16+
uses: actions/upload-artifact@v3
1217
with:
13-
auto-activate-base: true
14-
installer-url: https://github.com/conda-forge/miniforge/releases/download/4.10.1-0/Miniforge-pypy3-4.10.1-0-Linux-x86_64.sh
15-
channels: anaconda,conda-forge,loop3d,conda-forge/label/cf202003
16-
python-version: 3.8
17-
- name: Build documentation
18-
shell: bash -l {0}
19-
env:
20-
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
21-
run: |
22-
conda install -c conda-forge theano cython numpy pandas imageio scipy matplotlib sphinx sphinx-gallery sphinxcontrib-bibtex pydata-sphinx-theme myst-parser scikit-learn scikit-image pyamg flake8 pytest networkx python=3.9 -y
23-
pip install lavavu-osmesa
24-
python setup.py install build_ext --inplace
25-
cd docs
26-
make html
18+
path: docs/build/html
19+
- name: Deploy 🚀
20+
uses: JamesIves/[email protected]
21+
with:
22+
branch: gh-pages # The branch the action should deploy to.
23+
folder: docs/build/html # The folder the action should deploy.
24+
25+

.github/workflows/pypi.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: "📦 PyPI "
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
make_sdist:
7+
name: Make SDist
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Build SDist
13+
run: |
14+
pip install build
15+
python -m build
16+
17+
- uses: actions/upload-artifact@v4
18+
with:
19+
name: dist
20+
path: dist/
21+
22+
upload_to_pypi:
23+
needs: ["make_sdist"]
24+
runs-on: "ubuntu-latest"
25+
26+
steps:
27+
- uses: actions/download-artifact@v4
28+
with:
29+
name: dist
30+
path: dist
31+
- uses: pypa/gh-action-pypi-publish@release/v1
32+
with:
33+
skip_existing: true
34+
verbose: true
35+
user: ${{ secrets.PYPI_USERNAME }}
36+
password: ${{ secrets.PYPI_PASSWORD }}

0 commit comments

Comments
 (0)