-
Notifications
You must be signed in to change notification settings - Fork 11
149 lines (145 loc) · 4.69 KB
/
CD.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
on: [push, pull_request]
name: release-please
jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install black ruff
- name: Autoformat with black
run: |
black .
- name: Lint with ruff
run: |
ruff check . --fix
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "style: style fixes by ruff and autoformatting by black"
continuous-integration:
name: Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python }}
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
- name: Installing dependencies
shell: bash -l {0}
run: |
conda install -c loop3d --file dependencies.txt -y
- name: Building and install
shell: bash -l {0}
run: |
pip install .
documentation-test:
runs-on: ubuntu-latest
#needs: continuous-integration
steps:
- uses: actions/checkout@v2
- run: |
cp CHANGELOG.md docs/source/CHANGELOG.md
docker build . -t=docs -f docs/Dockerfile
docker run -v $(pwd):/map2loop docs bash map2loop/docs/build_docs.sh
- name: upload artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: docs/build/html
release-please:
runs-on: ubuntu-latest
needs: continuous-integration
if: github.ref == 'refs/heads/master'
steps:
- uses: GoogleCloudPlatform/release-please-action@v3
id: release
with:
release-type: python
package-name: map2loop
include-v-in-tag: false
outputs:
release_created: ${{ steps.release.outputs.release_created }}
conda-deploy:
name: Uploading to Loop3d for python ${{ matrix.os }})
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
steps:
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
- uses: actions/checkout@v2
- name: update submodules
run: |
git submodule update --init --recursive
- name: Add msbuild to PATH
if: matrix.os == 'windows-latest'
uses: microsoft/[email protected]
- name: Conda build'
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -l {0}
run: |
conda install conda-build
conda install -c loop3d --file dependencies.txt -y
conda build -c loop3d --no-test --python ${{ matrix.python-version }} --output-folder conda conda
conda install anaconda-client -y
- name: upload windows
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: matrix.os == 'windows-latest'
shell: bash -l {0}
run: |
anaconda upload --label main conda/win-64/*.tar.bz2
- name: upload linux
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: matrix.os == 'ubuntu-latest'
shell: bash -l {0}
run: |
anaconda upload --label main conda/linux-64/*.tar.bz2
- name: upload macosx
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
if: matrix.os == 'macos-latest'
shell: bash -l {0}
run: |
anaconda upload --label main conda/osx-64/*.tar.bz2
documentation-deploy:
runs-on: ubuntu-latest
needs: release-please
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v3
with:
name: docs
path: docs
- name: ls
run: |
ls -l docs
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: docs # The folder the action should deploy.