-
Notifications
You must be signed in to change notification settings - Fork 4
127 lines (109 loc) · 3.67 KB
/
repackage_pypy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Repackage PyPy
on:
workflow_dispatch:
inputs:
pypy_version:
required: true
type: string
platforms:
required: true
type: string
default: "linux-x86_64,linux-aarch64,macos,windows"
workflow_call:
inputs:
pypy_version:
required: true
type: string
platforms:
required: true
type: string
env:
image_map: '{"x86_64": "amd64/ubuntu:20.04", "aarch64": "arm64v8/ubuntu:20.04"}'
platform_map: '{"x86_64": "linux/amd64", "aarch64": "linux/arm64/v8"}'
jobs:
build_linux:
name: Linux ${{ inputs.pypy_version }} ${{ matrix.arch }}
if: ${{ contains(inputs.platforms, 'linux') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
exclude:
- arch: ${{ !contains(inputs.platforms, 'linux-x86_64') && 'x86_64' || '' }}
- arch: ${{ !contains(inputs.platforms, 'linux-aarch64') && 'aarch64' || '' }}
steps:
- name: Parse image
id: parse_image
run: |
IMAGE=$(echo ${{ toJSON(env.image_map) }} | jq -r '.["${{ matrix.arch }}"]')
echo "image=$IMAGE" >> "$GITHUB_OUTPUT"
- name: Parse platform
id: parse_platform
run: |
PLATFORM=$(echo ${{ toJSON(env.platform_map) }} | jq -r '.["${{ matrix.arch }}"]')
echo "platform=$PLATFORM" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Repackage
uses: addnab/docker-run-action@v3
with:
image: ${{ steps.parse_image.outputs.image }}
options: --platform ${{ steps.parse_platform.outputs.platform }} -v ${{ github.workspace }}:/work --workdir /work
shell: bash
run: |
set -ex
./scripts/repackage_pypy.sh ${{ matrix.arch }} ${{ inputs.pypy_version }} linux
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pypy-linux-${{ matrix.arch }}-${{ inputs.pypy_version }}
path: ./pypy*.zip
build_windows:
name: Windows ${{ inputs.pypy_version }} x86_64
if: ${{ contains(inputs.platforms, 'windows') }}
runs-on: windows-latest
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout
uses: actions/checkout@v4
- name: Repackage
shell: bash
run: |
set -ex
./scripts/repackage_pypy.sh x86_64 ${{ inputs.pypy_version }} windows
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pypy-windows-x86_64-${{ inputs.pypy_version }}
path: ./pypy*.zip
build_macos:
name: MacOS ${{ inputs.pypy_version }} ${{ matrix.arch }}
if: ${{ contains(inputs.platforms, 'macos') }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
include:
- arch: x86_64
runner: macos-13
- arch: aarch64
runner: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Repackage
run: |
set -ex
./scripts/repackage_pypy.sh ${{ matrix.arch }} ${{ inputs.pypy_version }} darwin
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pypy-darwin-${{ matrix.arch }}-${{ inputs.pypy_version }}
path: ./pypy*.zip