-
Notifications
You must be signed in to change notification settings - Fork 103
89 lines (86 loc) · 2.71 KB
/
build_pyodide_wheels.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
name: Build pyodide/wasm wheels
on:
push:
branches:
- main
paths:
- '**'
- '!*'
- '*.py'
- '!tests/**'
- '!doc/**'
- '!.github/**'
- '.github/pyodide_meta.yaml'
- '.github/pyodide_gsl_meta.yaml'
- '.github/workflows/build_pyodide_wheels.yml'
pull_request:
branches:
- main
paths:
- '**'
- '!tests/**'
- '!doc/**'
- '!.github/**'
- '.github/pyodide_meta.yaml'
- '.github/pyodide_gsl_meta.yaml'
- '.github/workflows/build_pyodide_wheels.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build pyodide/wasm wheels
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.10.2
- uses: mymindstorm/setup-emsdk@v12
with:
version: 3.1.14
- run: pip install pyodide-build==0.21.0
- name: Build wheel
run: |
# From https://github.com/pyodide/pyodide/issues/3002#issuecomment-1248513970
# Set up libs dir and pkg config
mkdir .libs
export LIBDIR=`pwd`/.libs
export PKG_CONFIG_PATH=`pwd`/.libs/lib/pkgconfig
# Build gsl
wget https://ftp.gnu.org/gnu/gsl/gsl-2.7.tar.gz
tar -xvzf gsl-2.7.tar.gz
cd gsl-2.7
emconfigure ./configure \
CFLAGS="-fPIC" \
--prefix=$LIBDIR \
--disable-dependency-tracking \
--disable-shared
emmake make -j 3
emmake make install
# Build galpy
cd ..
CFLAGS=`pkg-config --cflags-only-I --dont-define-prefix gsl` \
LDFLAGS=`pkg-config --libs-only-L --dont-define-prefix gsl` \
pyodide build
- name: Rename wheels to 'latest' version
run: |
GALPY_VERSION="$(awk '/^current_version/{print $NF}' .bumpversion.cfg)"
for f in dist/*$GALPY_VERSION*; do sudo mv -i -- "$f" "${f//$GALPY_VERSION/latest}"; done
- uses: actions/upload-artifact@v3
with:
name: galpy-wheel-pyodide
path: dist/*.whl
# Upload to AWS S3
- name: Upload to AWS S3
uses: jakejarvis/s3-sync-action@v0.5.1
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-2'
SOURCE_DIR: dist
DEST_DIR: wheelhouse