Skip to content

Commit c41ffa7

Browse files
committed
make pyodide version configurable instead of python and emscripten version
1 parent fc5a7f2 commit c41ffa7

File tree

2 files changed

+26
-33
lines changed

2 files changed

+26
-33
lines changed

.github/workflows/link-pyodide.yaml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
name: Link & Release Pyodide for workerd (0.26.0a3) # To change the version, update pyodide/Makefile
1+
name: Link & Release Pyodide for workerd
22
on:
33
workflow_dispatch:
44
inputs:
55
tag:
66
description: Version Tag
77
required: true
8-
python_version:
9-
description: Python Version
8+
pyodide_version:
9+
description: Version of pyodide
1010
required: true
11-
default: "3.12.1"
12-
emscripten_version:
13-
description: Emscripten Version
14-
required: true
15-
default: "3.1.52"
11+
default: "0.26.0a4"
1612

1713
jobs:
1814
pyodide-link:
@@ -22,19 +18,32 @@ jobs:
2218
steps:
2319
- name: Checkout
2420
uses: actions/checkout@v4
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: 3.12
26+
27+
- name: Get Python and Emscripten versions
28+
run:
29+
pip3 install pyodide-build==${{ inputs.pyodide_version }}
30+
pyodide config get python_version > python_version.txt
31+
pyodide config get emscripten_version > emscripten_version.txt
32+
pyodide config list
2533

2634
- name: Link & Release Pyodide
2735
env:
28-
PYVERSION: ${{ inputs.python_version }}
29-
PYODIDE_EMSCRIPTEN_VERSION: ${{ inputs.emscripten_version }}
36+
PYODIDE_VERSION: ${{ inputs.pyodide_version }}
3037
run: |
38+
export PYVERSION = $(cat python_version.txt)
39+
export PYODIDE_EMSCRIPTEN_VERSION = $(cat emscripten_version.txt)
3140
cd pyodide
3241
make -C emsdk
3342
source emsdk/emsdk/emsdk_env.sh
3443
make
3544
mv dist pyodide
3645
tar cjf pyodide-asm.tar.bz2 pyodide/
37-
echo "SHA-256 checksum: $(sha256sum pyodide-asm.tar.bz2)" > release_body.txt
46+
echo "SHA-256 checksum: $(sha256sum pyodide-asm.tar.bz2 | cut -d ' ' -f 1)" > release_body.txt
3847
3948
- name: Create GitHub Release for Linked Pyodide
4049
uses: ncipollo/release-action@v1

pyodide/Makefile

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ LIBS= \
7272
-lpyodide \
7373

7474

75+
# No need to perform integrity checking here since we are only running this on Github Actions
76+
# We assume that Github Actions has a secure connection to github.com
7577

76-
LIB_URL=https://github.com/pyodide/pyodide/releases/download/0.26.0a3/static-libraries-0.26.0a3.tar.bz2
77-
LIB_SHA256=b59e9b03410c2acf5b7335a74902991a0f0f51ada5fcd1372b50db4a7fb3c306
78-
LIB_TARBALL=download/static-libraries-0.26.0a3.tar.bz2
78+
LIB_URL=https://github.com/pyodide/pyodide/releases/download/${PYODIDE_VERSION}/static-libraries-${PYODIDE_VERSION}.tar.bz2
79+
LIB_TARBALL=download/static-libraries-${PYODIDE_VERSION}.tar.bz2
7980
LIB_INSTALL_MARK=$(PYTHON_INSTALL)/.installed-pyodide
8081

81-
PYODIDE_CORE_URL=https://github.com/pyodide/pyodide/releases/download/0.26.0a3/pyodide-core-0.26.0a3.tar.bz2
82-
PYODIDE_CORE_SHA256=f21e9922f070787b149f290e575c673cda3e963fef908a362542ad10826b279a
83-
PYODIDE_TARBALL=download/pyodide-core-0.26.0a3.tar.bz2
82+
PYODIDE_CORE_URL=https://github.com/pyodide/pyodide/releases/download/${PYODIDE_VERSION}/pyodide-core-${PYODIDE_VERSION}.tar.bz2
83+
PYODIDE_TARBALL=download/pyodide-core-${PYODIDE_VERSION}.tar.bz2
8484
PYODIDE_INSTALL=download/pyodide
8585
PYODIDE_INSTALL_MARK=$(PYODIDE_INSTALL)/.installed-pyodide
8686

@@ -95,14 +95,6 @@ emsdk/emsdk/.complete:
9595
$(LIB_TARBALL):
9696
mkdir -p download
9797
wget -O $@ $(LIB_URL)
98-
@GOT_SHASUM=`shasum --algorithm 256 $@ | cut -f1 -d' '` \
99-
&& (echo $$GOT_SHASUM | grep -q $(LIB_SHA256)) \
100-
|| (\
101-
rm $@ \
102-
&& echo "Got unexpected shasum $$GOT_SHASUM" \
103-
&& echo "If you are updating, set LIB_SHA256 to this." \
104-
&& exit 1 \
105-
)
10698

10799
$(LIB_INSTALL_MARK): $(LIB_TARBALL)
108100
tar -xf $(LIB_TARBALL) -C download
@@ -111,14 +103,6 @@ $(LIB_INSTALL_MARK): $(LIB_TARBALL)
111103
$(PYODIDE_TARBALL):
112104
mkdir -p download
113105
wget -O $@ $(PYODIDE_CORE_URL)
114-
@GOT_SHASUM=`shasum --algorithm 256 $@ | cut -f1 -d' '` \
115-
&& (echo $$GOT_SHASUM | grep -q $(PYODIDE_CORE_SHA256)) \
116-
|| (\
117-
rm $@ \
118-
&& echo "Got unexpected shasum $$GOT_SHASUM" \
119-
&& echo "If you are updating, set PYODIDE_CORE_SHA256 to this." \
120-
&& exit 1 \
121-
)
122106

123107
$(PYODIDE_INSTALL_MARK): $(PYODIDE_TARBALL)
124108
tar -xf $(PYODIDE_TARBALL) -C download

0 commit comments

Comments
 (0)