Packages the distutils stdlib module as a standalone package,
```
377K distutils.data
221K distutils.data.br
19K distutils.js
```
to reduce the minimal pyodide size.

Part of #1542 

This also,
 - adds documentation on what's supported or not in the stdlib
 - makes a few changes to `pyodide_build/buildall.py` to be able to add such stdlib packages as a dependency in other packages (which didn't work before). For instance, until there is a release with https://github.com/pypa/packaging/pull/396 micropip has a dependency on distutils.
Unvendor distutils. Packages the distutils stdlib module as a standalone package,
```
377K distutils.data
221K distutils.data.br
19K distutils.js
```
to reduce the minimal pyodide size.

Part of #1542 

This also,
 - adds documentation on what's supported or not in the stdlib
 - makes a few changes to `pyodide_build/buildall.py` to be able to add such stdlib packages as a dependency in other packages (which didn't work before). For instance, until there is a release with https://github.com/pypa/packaging/pull/396 micropip has a dependency on distutils.
on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Version of the docker image to build.
          The same version of the pyodide-env image must already exist'
        required: true

jobs:
  build_image:
    runs-on: ubuntu-latest
#   This is the recommended use of github's docker build-push action
#   See https://github.com/marketplace/actions/build-and-push-docker-images#git-context
    steps:
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Build and push
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          file: ./Dockerfile-prebuilt
          push: true
          build-args: |
            VERSION=${{ github.event.inputs.version }}
          tags: "iodide/pyodide:${{ github.event.inputs.version }}"
      -
        name: Image digest
        run: echo ${{ steps.docker_build.outputs.digest }}

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Version of the docker image to build.
          The same version of the pyodide-env image must already exist'
        required: true

jobs:
  build_image:
    runs-on: ubuntu-latest
#   This is the recommended use of github's docker build-push action
#   See https://github.com/marketplace/actions/build-and-push-docker-images#git-context
    steps:
      -
        name: Set up QEMU
        uses: docker/setup-qemu-action@v1
      -
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
      -
        name: Login to DockerHub
        uses: docker/login-action@v1
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}
      -
        name: Build and push
        id: docker_build
        uses: docker/build-push-action@v2
        with:
          file: ./Dockerfile-prebuilt
          push: true
          build-args: |
            VERSION=${{ github.event.inputs.version }}
          tags: "iodide/pyodide:${{ github.event.inputs.version }}"
      -
        name: Image digest
        run: echo ${{ steps.docker_build.outputs.digest }}
