Generate Pex Scie Complete Platforms #44
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate Pex Scie Complete Platforms | |
on: | |
workflow_dispatch: | |
inputs: | |
pbs-release: | |
description: The PBS release to use. | |
required: true | |
python-version: | |
description: The PBS Python version to use. | |
required: true | |
defaults: | |
run: | |
shell: bash | |
env: | |
SCIENCE_AUTH_API_GITHUB_COM_BEARER: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
gen-complete-platform: | |
name: Generate Platform for ${{ matrix.platform }} | |
strategy: | |
matrix: | |
include: | |
- platform: Linux x86_64 | |
os: ubuntu-24.04 | |
docker-arch: amd64 | |
artifact-name: linux-x86_64 | |
- platform: Linux aarch64 | |
os: ubuntu-24.04 | |
docker-arch: arm64 | |
artifact-name: linux-aarch64 | |
- platform: macOS x86_64 | |
os: macos-13 | |
artifact-name: macos-x86_64 | |
- platform: macOS arm64 | |
os: macos-14 | |
artifact-name: macos-aarch64 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout Pex | |
uses: actions/checkout@v4 | |
- name: Generate Generate Script | |
id: generate | |
run: | | |
dest_dir="$(mktemp -d)" | |
echo "dest-dir=${dest_dir}" >> "${GITHUB_OUTPUT}" | |
cat << EOF > ./gen-scie-platform.sh | |
#!/usr/bin/env bash | |
python -m venv .venv | |
source .venv/bin/activate | |
pip install -U pip | |
pip install -U tox | |
python -V | |
tox -e gen-scie-platform -- \ | |
-d "${dest_dir}" \ | |
--pbs-release ${{ github.event.inputs.pbs-release }} \ | |
--python-version ${{ github.event.inputs.python-version }} | |
EOF | |
chmod +x ./gen-scie-platform.sh | |
- name: Setup Docker QEMU Emulation | |
uses: docker/setup-qemu-action@v3 | |
if: ${{ matrix.docker-arch }} | |
with: | |
platforms: linux/${{ matrix.docker-arch }} | |
- name: Generate Complete Platform | |
if: ${{ matrix.docker-arch }} | |
run: | | |
docker run \ | |
--rm \ | |
-v "${{ steps.generate.outputs.dest-dir }}:${{ steps.generate.outputs.dest-dir }}" \ | |
-v $PWD:/code \ | |
-w /code \ | |
--platform linux/${{ matrix.docker-arch }} \ | |
python:3.11-slim-bullseye bash ./gen-scie-platform.sh | |
- name: Setup Python 3.11 | |
if: ${{ ! matrix.docker-arch }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
- name: Generate Complete Platform | |
if: ${{ ! matrix.docker-arch }} | |
run: ./gen-scie-platform.sh | |
- name: Upload Complete Platform File Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: complete-platform-${{ matrix.artifact-name }} | |
path: ${{ steps.generate.outputs.dest-dir }}/* |