11on :
22 push :
3+ branches :
4+ - master
5+ env :
6+ PACKAGE_NAME : LoopStructural
7+
38name : release-please
49jobs :
5- linting :
6- name : Linting
7- runs-on : ubuntu-latest
8- steps :
9- - uses : actions/checkout@v4
10- - name : Install dependencies
11- run : |
12- python -m pip install --upgrade pip
13- pip install black ruff
14- - name : Autoformat with black
15- run : |
16- black .
17- - name : Lint with ruff
18- run : |
19- ruff check LoopStructural --fix
20- - uses : stefanzweifel/git-auto-commit-action@v5
21- with :
22- commit_message : " style: style fixes by ruff and autoformatting by black"
23-
24- continuous-integration :
25- name : Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }}
26- runs-on : ${{ matrix.os }}
27- strategy :
28- fail-fast : false
29- matrix :
30- os : ${{ fromJSON(vars.BUILD_OS)}}
31- python-version : ${{ fromJSON(vars.PYTHON_VERSIONS)}}
32- steps :
33- - uses : actions/checkout@v4
34- - uses : conda-incubator/setup-miniconda@v3
35-
36- with :
37- python-version : ${{ matrix.python }}
38- - name : Installing dependencies
39- shell : bash -l {0}
40- run : |
41- conda install -c conda-forge numpy scipy scikit-image scikit-learn pytest networkx osqp matplotlib -y
42- - name : Building and install
43- shell : bash -l {0}
44- run : |
45- pip install . --user
46- - name : pytest
47- shell : bash -l {0}
48- run : |
49- pytest
50- documentation-test :
51- runs-on : ubuntu-latest
52- # needs: continuous-integration
53- steps :
54- - uses : actions/checkout@v4
55- - run : |
56- cp CHANGELOG.md docs/source/getting_started/CHANGELOG.md
57- docker build . -t=lsdocs -f docs/Dockerfile
58- docker run -v $(pwd):/LoopStructural lsdocs bash LoopStructural/docs/build_docs.sh
59- - name : upload artifacts
60- uses : actions/upload-artifact@v3
61- with :
62- path : docs/build/html
63-
6410 release-please :
6511 runs-on : ubuntu-latest
66- needs : documentation-test
67- if : github.ref == 'refs/heads/master'
6812 steps :
6913 - uses : GoogleCloudPlatform/release-please-action@v4
7014 id : release
@@ -74,109 +18,23 @@ jobs:
7418 version-file : LoopStructural/version.py
7519 outputs :
7620 release_created : ${{ steps.release.outputs.release_created }}
77- # if a release is created then run the deploy scripts for github.io, conda, pypi and docker
78- documentation-deploy :
79- runs-on : ubuntu-latest
21+ package :
8022 needs : release-please
8123 if : ${{ needs.release-please.outputs.release_created }}
8224 steps :
83- - uses : actions/checkout@v4
84- - run : |
85- cp CHANGELOG.md docs/source/getting_started/CHANGELOG.md
86- docker build . -t=lsdocs -f docs/Dockerfile
87- docker run -v $(pwd):/LoopStructural lsdocs bash LoopStructural/docs/build_docs.sh
88- - name : Deploy 🚀
89- uses : JamesIves/github-pages-deploy-action@4.1.3
90- with :
91- branch : gh-pages # The branch the action should deploy to.
92- folder : docs/build/html # The folder the action should deploy.
93-
94- conda-deploy :
95- name : Building conda package for python ${{ matrix.os }})
96- needs : ["documentation-test", "continuous-integration", "release-please"]
97- runs-on : ubuntu-latest
98- if : github.ref == 'refs/heads/master'
99-
100- strategy :
101- fail-fast : false
102- matrix :
103- python-version : ${{ fromJSON(vars.PYTHON_VERSIONS)}}
104- steps :
105- - uses : conda-incubator/setup-miniconda@v3
106- with :
107- auto-update-conda : true
108- python-version : ${{ matrix.python-version }}
109- - uses : actions/checkout@v4
110- - name : update submodules
111- # shell: bash -l {0}
112- run : |
113- git submodule update --init --recursive
114- - name : Conda build
115- env :
116- ANACONDA_API_TOKEN : ${{ secrets.ANACONDA_TOKEN }}
117- shell : bash -l {0}
118- run : |
119- conda install -c conda-forge conda-build scikit-build numpy cython anaconda-client conda-libmamba-solver -y
120- conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{matrix.python-version}}
121- conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda
122- - name : upload artifacts
123- uses : actions/upload-artifact@v4
124- with :
125- name : conda-build-${{ matrix.python-version }}
126- path : conda
127-
128- make_sdist :
129- needs : ["documentation-test", "continuous-integration", "release-please"]
130- name : Make SDist
131- runs-on : ubuntu-latest
132-
133- steps :
134- - uses : actions/checkout@v4
135-
136- - name : Build SDist
25+ - name : Trigger build for pypi and upload
13726 run : |
138- pip install build
139- python -m build
140-
141- - uses : actions/upload-artifact@v4
142- with :
143- name : dist
144- path : dist/
145-
146- upload_to_conda :
147- runs-on : ubuntu-latest
148- needs : ["release-please", "conda-deploy"]
149- strategy :
150- fail-fast : false
151- matrix :
152- python-version : ${{ fromJSON(vars.PYTHON_VERSIONS)}}
153- if : ${{ needs.release-please.outputs.release_created }}
154- steps :
155- - uses : actions/download-artifact@v4
156- with :
157- name : conda-build-${{ matrix.python-version }}
158- path : conda
159- - uses : conda-incubator/setup-miniconda@v3
160- - name : upload all files to conda-forge
161- shell : bash -l {0}
162- env :
163- ANACONDA_API_TOKEN : ${{ secrets.ANACONDA_TOKEN }}
27+ curl -X POST \
28+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
29+ -H "Accept: application/vnd.github.v3+json" \
30+ https://api.github.com/repos/Loop3d/${{env.PACKAGE_NAME}}/actions/workflows/pypi.yml/dispatches \
31+ -d '{"ref":"master"}'
32+ - name : Trigger build for conda and upload
16433 run : |
165- conda install -c anaconda anaconda-client -y
166- anaconda upload --label main conda/*/*.tar.bz2
167- upload_to_pypi :
168- needs : ["release-please", " conda-deploy"]
169- runs-on : " ubuntu-latest "
34+ curl -X POST \
35+ -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
36+ -H "Accept: application/vnd.github.v3+json" \
37+ https://api.github.com/repos/Loop3d/${{env.PACKAGE_NAME}}/actions/workflows/ conda.yml/dispatches \
38+ -d '{"ref":"master"}'
17039
171- if : ${{ needs.release-please.outputs.release_created }}
172- steps :
173- - uses : actions/download-artifact@v4
174- with :
175- name : dist
176- path : dist
177- - uses : pypa/gh-action-pypi-publish@release/v1
178- with :
179- skip_existing : true
180- verbose : true
181- user : ${{ secrets.PYPI_USERNAME }}
182- password : ${{ secrets.PYPI_PASSWORD }}
40+
0 commit comments