Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Merge branch 'main' into spawn #74

Merge branch 'main' into spawn

Merge branch 'main' into spawn #74

Workflow file for this run

name: Python
on:
push:
paths:
- 'python/*'
- '.github/workflows/python.yaml'
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Build docker image
working-directory: python
run: |
docker build -t builder .
- name: Compile
working-directory: python
run: |
docker run -v `pwd`:/src -w /src -e NO_OPT=true builder ./build.sh
- name: Check for output
run: |
find . -name python.wasm
find . -name python311.zip
- name: Archive build output
uses: actions/upload-artifact@v3
with:
name: python-wasm-stdlib
path: |
python/cpython/python.wasm
python/cpython/usr/local/lib/python311.zip
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Copy build output to public S3
run: |
aws s3 cp python/cpython/python.wasm s3://timecraft/python/$GITHUB_SHA/python.wasm
aws s3 cp python/cpython/usr/local/lib/python311.zip s3://timecraft/python/$GITHUB_SHA/python311.zip
- name: Copy build output to public S3 main
if: ${{ github.ref == 'refs/heads/main' }}
run: |
aws s3 cp python/cpython/python.wasm s3://timecraft/python/main/python.wasm
aws s3 cp python/cpython/usr/local/lib/python311.zip s3://timecraft/python/main/python311.zip
build_vanilla:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
- name: Build docker image
working-directory: python
run: |
docker build -t builder .
- name: Compile
working-directory: python
run: |
docker run -v `pwd`:/src -w /src -e NO_OPT=true -e NO_WASMEDGE=true builder ./build.sh
- name: Check for output
run: |
find . -name python.wasm
find . -name python311.zip
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: us-east-1
- name: Copy build output to public S3
run: |
aws s3 cp python/cpython/python.wasm s3://timecraft/python-vanilla/$GITHUB_SHA/python.wasm
aws s3 cp python/cpython/usr/local/lib/python311.zip s3://timecraft/python-vanilla/$GITHUB_SHA/python311.zip
- name: Copy build output to public S3 main
if: ${{ github.ref == 'refs/heads/main' }}
run: |
aws s3 cp python/cpython/python.wasm s3://timecraft/python-vanilla/main/python.wasm
aws s3 cp python/cpython/usr/local/lib/python311.zip s3://timecraft/python-vanilla/main/python311.zip
docker-build:
runs-on: ubuntu-latest
env:
PAT_PACKAGES: ${{ secrets.PAT_PACKAGES }}
needs: build_and_test
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
- name: Download build output
uses: actions/download-artifact@v3
with:
name: python-wasm-stdlib
path: python/cpython
- run: echo $PAT_PACKAGES | docker login ghcr.io -u USERNAME --password-stdin
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
working-directory: python
run: |
echo "noop: make docker-buildx"