Skip to content

Commit

Permalink
Python 3.12: Try to get arm64 builds working.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Apr 26, 2024
1 parent 12b29ee commit 7c54c15
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 19 deletions.
41 changes: 22 additions & 19 deletions .github/workflows/_build-and-cache-by-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,43 @@ permissions: read-all
jobs:
compile_ubuntu:
runs-on: ubuntu-latest
name: "📦 Ubuntu ${{ matrix.Release }} (${{ matrix.Arch }})"
name: "📦 Ubuntu ${{ matrix.release.version }} (${{ matrix.arch }})"
strategy:
fail-fast: false
matrix:
Release:
- "20.04"
- "22.04"
Arch:
release:
- version: "20.04"
name: focal
- version: "22.04"
name: jammy
arch:
- amd64
- arm64

container:
image: "ghcr.io/northwood-labs/package-builder/ubuntu-v${{ matrix.Release }}:latest"
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
options: --privileged --platform "linux/${{ matrix.Arch }}"

steps:
- name: Git clone
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ github.base_ref }}

- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
with:
platforms: ${{ matrix.arch }}

- name: Compile the software from source
working-directory: packages/${{ inputs.package-name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PKG_VER: "${{ inputs.package-version }}"
run: |
# Run the compile script for Ubuntu
# Variables are defined by the Docker container this is running in.
bash "./compile-${OS_DIST}-${OS_DIST_NAME}.sh"
docker run \
--rm \
--env GITHUB_TOKEN \
--volume "$PWD:/${{ github.workspace }}" \
--workdir ${{ github.workspace }} \
--platform linux/${{ matrix.arch }} \
"ghcr.io/northwood-labs/package-builder/ubuntu-v${{ matrix.release.version }}:latest" \
bash packages/${{ inputs.package-name }}/compile-ubuntu-${{ matrix.release.name }}.sh "${{ inputs.package-version }}"
- name: Package the compiled software
working-directory: packages/${{ inputs.package-name }}
Expand All @@ -72,14 +77,12 @@ jobs:
# Decode the contents into files.
echo -n "${GPG_KEY_B64}" | base64 --decode > 3C7658F0.asc
ls -lahF
mkdir -p ./dist
nfpm package --config nfpm-${OS_DIST}-${OS_DIST_NAME}.yaml --packager deb --target ./dist
- name: Cache the packages
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
id: cache-packages
with:
key: "${{ inputs.package-name }}-${{ inputs.package-version }}-${OS_DIST}-${OS_DIST_NAME}-${{ matrix.Arch }}"
key: "${{ inputs.package-name }}-${{ inputs.package-version }}-ubuntu-${{ matrix.release.version }}-${{ matrix.arch }}"
path: packages/${{ inputs.package-name }}/dist
31 changes: 31 additions & 0 deletions packages/python3.12/nfpm-ubuntu-jammy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: python3.12
arch: "{{ .Arch }}"
platform: linux
version: ${PKG_VER}
release: 1
section: default
maintainer: Northwood Labs <[email protected]>
description: |-
Python is a clear and powerful object-oriented programming language,
comparable to Perl, Ruby, Scheme, or Java.
vendor: python authors
homepage: https://www.python.org
license: PSF-2.0
disable_globbing: false
provides:
- 2to3-3.12
- idle3.12
- pip3.12
- pydoc3.12
- python3.12
- python3.12-config
contents:
- src: /tmp/install/usr
dst: /usr
umask: 0o002
# scripts:
# postinstall: postinstall.sh
deb:
signature:
key_file: 3C7658F0.asc
type: archive

0 comments on commit 7c54c15

Please sign in to comment.