-
Notifications
You must be signed in to change notification settings - Fork 11
135 lines (123 loc) · 3.52 KB
/
release.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
name: Release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build wheels
uses: pypa/[email protected]
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz
# Don't upload this one to pypi, otherwise it will be preferred over every compiled one
# We can host it here on github though for those that need it (re: jupyter-light).
pure_python:
name: Create pure-python wheel
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Build pure python wheel and install
run: |
python -m pip install --user --upgrade build
python -m build
find ./dist/*.whl | xargs pip install
python -c "import geoana; geoana.show_config()"
- uses: actions/upload-artifact@v4
with:
path: ./dist/geoana*.whl
distribute:
name: Distribute documentation
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
environment-file: .github/environment_ci.yml
activate-environment: geoana-test
python-version: "3.11"
- name: Install Our Package
run: |
pip install --no-build-isolation --editable . --config-settings=setup-args="-Dwith_extensions=true"
- name: Build documentation
run: |
cd docs
make html
cd ..
- name: GitHub Pages
uses: crazy-max/[email protected]
with:
build_dir: docs/_build/html
fqdn: geoana.simpeg.xyz
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create Release
needs: [
build_wheels,
build_sdist,
pure_python
]
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true
- name: Release to github
uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true
prerelease: false
- name: Remove anywheel before pypi upload
run: rm -f dist/geoana*none-any.whl
- name: Upload wheels to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
packages-dir: ./dist/