Generate Pex Scie Complete Platforms #26
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: | |
dest-dir: | |
description: The directory to generate the complete platform files in. | |
default: package/complete-platforms | |
required: false | |
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-22.04 | |
docker-arch: amd64 | |
artifact-name: linux-x86_64 | |
- platform: Linux aarch64 | |
os: ubuntu-22.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 | |
run: | | |
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 "${{ github.event.inputs.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 $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: ${{ github.event.inputs.dest-dir }}/* |