Skip to content

CI: parametrize the package to build and upload the artifact #4

CI: parametrize the package to build and upload the artifact

CI: parametrize the package to build and upload the artifact #4

Workflow file for this run

name: Build
on:
push:
pull_request:
workflow_dispatch:
jobs:
run_build:
runs-on: ubuntu-latest
strategy:
matrix:
packages: ["https://github.com/Pylons/paginate"]
fail-fast: false
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.2
- name: Define package to build
run: |
set -vxeuo pipefail
export PACKAGE_SOURCE="${{ matrix.packages }}"
# https://stackoverflow.com/a/3162500:
export PACKAGE_NAME="${PACKAGE_SOURCE##*/}"
echo PACKAGE_SOURCE=${PACKAGE_SOURCE} >> $GITHUB_ENV
echo PACKAGE_NAME=${PACKAGE_NAME} >> $GITHUB_ENV
- name: Set up env vars for EMSCRIPTEN_VERSION
run: |
set -vxeuo pipefail
pip install pyodide-build>=0.23.0
export EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version)
echo EMSCRIPTEN_VERSION=${EMSCRIPTEN_VERSION} >> $GITHUB_ENV
echo "EMSCRIPTEN_VERSION is $EMSCRIPTEN_VERSION"
- name: Set up Emscripten
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- name: Build with Pyodide
run: |
set -vxeuo pipefail
git clone ${{ env.PACKAGE_SOURCE }}
cd ${{ env.PACKAGE_NAME }}
pyodide build
ls -la
- uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}
path: ${{ env.PACKAGE_NAME }}/dist/${{ env.PACKAGE_NAME }}-*.whl