Build pypy 7.3.13 #64
Workflow file for this run
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: Build PyPy | |
on: | |
push: | |
branches: | |
- '**' | |
paths: | |
- 'builder/**' | |
- '.github/workflows/build-pypy.yml' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: write | |
env: | |
ALPINE_VERSION: 3.18 | |
BUILDER_IMAGE_TAG: ghcr.io/cyb3r-jak3/alpine-pypy-builder-workflow | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Prep: | |
runs-on: ubuntu-latest | |
name: Prep Docker Container | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Login To GitHub | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: "builder/" | |
tags: ${{ env.BUILDER_IMAGE_TAG }}:${{ env.ALPINE_VERSION }}-${{ github.sha }} | |
build-args: | | |
BUILD_IMAGE=ghcr.io/cyb3r-jak3/alpine-pypy:2.7-7.3.11-3.17 | |
cache-to: type=gha,mode=max,scope=buildx-alpine-pypy-workflow-builder:${{ env.ALPINE_VERSION }} | |
cache-from: type=gha,scope=buildx-alpine-pypy-workflow-builder:${{ env.ALPINE_VERSION }} | |
platforms: linux/amd64, linux/arm64 | |
push: true | |
Build: | |
runs-on: ${{ matrix.RUNNER }} | |
name: Run Container | |
needs: Prep | |
strategy: | |
fail-fast: true | |
matrix: | |
PYPY_BASE: ["2.7", "3.9", "3.10"] | |
PYPY_VERSION: ["7.3.13"] | |
RUNNER: ["self-hosted", "ubuntu-latest"] | |
steps: | |
- name: Select pypy arch | |
env: | |
RUNS_ON: ${{ matrix.RUNNER }} | |
run: | | |
if [ $RUNS_ON = "self-hosted" ]; then | |
echo "PYPY_ARCH=aarch64" >> $GITHUB_ENV | |
else | |
echo "PYPY_ARCH=x86_64" >> $GITHUB_ENV | |
fi | |
- name: Check if file already exists | |
id: file-check | |
run: | | |
STATUS=$(curl -s -w "%{http_code}\n" -o /dev/null --head https://pypy.cyberjake.xyz/pypy/${{ matrix.PYPY_BASE }}/pypy${{ matrix.PYPY_BASE }}-v${{ matrix.PYPY_VERSION }}-linux-${{ env.PYPY_ARCH }}-alpine.tar.bz2) | |
echo "STATUS=$STATUS" >> $GITHUB_OUTPUT | |
- name: Login To GitHub | |
if: steps.file-check.outputs.STATUS == 404 | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up QEMU | |
if: steps.file-check.outputs.STATUS == 404 | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
if: steps.file-check.outputs.STATUS == 404 | |
uses: docker/setup-buildx-action@v2 | |
- name: Select build platform | |
if: steps.file-check.outputs.STATUS == 404 | |
env: | |
RUNS_ON: ${{ matrix.RUNNER }} | |
run: | | |
if [ $RUNS_ON = "self-hosted" ]; then | |
echo "ARCH=arm64" >> $GITHUB_ENV | |
else | |
echo "ARCH=amd64" >> $GITHUB_ENV | |
fi | |
- name: Run Build | |
if: steps.file-check.outputs.STATUS == 404 | |
run: | | |
PYPY_SHA256SUM=$(curl -s https://api.cyberjake.xyz/pypy/checksums/pypy${{ matrix.PYPY_BASE }}-v${{ matrix.PYPY_VERSION }}-src.tar.bz2 | jq --raw-output .results[0].checksum) | |
echo "${PYPY_SHA256SUM}" | |
docker run --platform linux/${{ env.ARCH }} -v $(pwd)/tmp:/tmp -e PYPY_BASE=${{ matrix.PYPY_BASE }} -e PYPY_VERSION=${{ matrix.PYPY_VERSION }} -e PYPY_SHA256SUM="${PYPY_SHA256SUM}" ${{ env.BUILDER_IMAGE_TAG }}:${{ env.ALPINE_VERSION }}-${{ github.sha }} | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@v5 | |
if: steps.file-check.outputs.STATUS == 404 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.PASSPHRASE }} | |
trust_level: 5 | |
- name: Prep files | |
if: steps.file-check.outputs.STATUS == 404 | |
run: | | |
mkdir output | |
mv ./tmp/usession-release-pypy${{ matrix.PYPY_BASE }}-v${{ matrix.PYPY_VERSION }}-*/build/**.tar.bz2 ./output/pypy${{ matrix.PYPY_BASE }}-v${{ matrix.PYPY_VERSION }}-linux-${{ env.PYPY_ARCH }}-alpine.tar.bz2 | |
# find ./downloads/ -type f | parallel 'echo "Signing {}"; gpg --quiet --batch --yes --detach-sig {}; sha256sum {} > {}.sha256sum; sha512sum {} > {}.sha512sum' | |
sha256sum ./output/pypy${{ matrix.PYPY_BASE }}-v${{ matrix.PYPY_VERSION }}-linux-${{ env.PYPY_ARCH }}-alpine.tar.bz2 > ./output/pypy${{ matrix.PYPY_BASE }}-v${{ matrix.PYPY_VERSION }}-linux-${{ env.PYPY_ARCH }}-alpine.tar.bz2.sha256sum | |
- name: Upload PyPy to Artifacts | |
if: steps.file-check.outputs.STATUS == 404 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pypy-${{ env.ARCH }} | |
path: ./output |