Skip to content

Commit 46fa008

Browse files
committed
Merge branch 'main' into 简中翻译
2 parents 16f3a25 + f5a7a9a commit 46fa008

File tree

258 files changed

+12505
-12274
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

258 files changed

+12505
-12274
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- run:
2828
name: Build the Linux wheels.
2929
command: |
30-
pip3 install --user cibuildwheel==2.10.2
30+
pip3 install --user cibuildwheel==2.12.0
3131
PATH="$HOME/.local/bin:$PATH" cibuildwheel --output-dir wheelhouse
3232
3333
- store_artifacts:

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
# Check for updates to GitHub Actions every week
7+
interval: "weekly"

.github/workflows/build-debian-multiarch.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,9 @@
44

55
name: Debian Multiarch
66

7-
# Run CI only when a release is created, on changes to main branch, or any PR
8-
# to main. Do not run CI on any other branch. Also, skip any non-source changes
9-
# from running on CI
7+
# Run CI only on changes to main branch, or any PR to main. Do not run CI on
8+
# any other branch. Also, skip any non-source changes from running on CI
109
on:
11-
release:
12-
types: [created]
1310
push:
1411
branches: main
1512
paths-ignore:
@@ -35,7 +32,7 @@ on:
3532
- '!.github/workflows/build-debian-multiarch.yml'
3633

3734
concurrency:
38-
group: ${{ github.workflow }}-${{ github.ref }}
35+
group: ${{ github.workflow }}-${{ github.ref }}-debian-multiarch
3936
cancel-in-progress: true
4037

4138
jobs:
@@ -53,7 +50,7 @@ jobs:
5350
- uses: actions/[email protected]
5451

5552
- name: Build sources and run tests
56-
uses: uraimo/run-on-arch-action@v2.3.0
53+
uses: uraimo/run-on-arch-action@v2.5.0
5754
id: build
5855
with:
5956
arch: ${{ matrix.arch }}

.github/workflows/build-emsdk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ on:
2828
- '!.github/workflows/build-emsdk.yml'
2929

3030
concurrency:
31-
group: ${{ github.workflow }}-${{ github.ref }}
31+
group: ${{ github.workflow }}-${{ github.ref }}-emsdk
3232
cancel-in-progress: true
3333

3434
jobs:

.github/workflows/build-macos.yml

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ name: MacOS
44
# to main. Do not run CI on any other branch. Also, skip any non-source changes
55
# from running on CI
66
on:
7-
release:
8-
types: [created]
97
push:
108
branches: main
119
paths-ignore:
@@ -29,9 +27,12 @@ on:
2927
- '.github/workflows/*.yml'
3028
# re-include current file to not be excluded
3129
- '!.github/workflows/build-macos.yml'
30+
31+
# the github release drafter can call this workflow
32+
workflow_call:
3233

3334
concurrency:
34-
group: ${{ github.workflow }}-${{ github.ref }}
35+
group: ${{ github.workflow }}-${{ github.ref }}-macos
3536
cancel-in-progress: true
3637

3738
jobs:
@@ -83,10 +84,10 @@ jobs:
8384
# of these builds take roughly the same time
8485
include:
8586
- {
86-
name: "x86_64 (CPython 3.6 3.10 and above)",
87+
name: "x86_64 (CPython 3.10 and above)",
8788
macarch: x86_64,
88-
# pattern matches 6 or any 2 digit number
89-
pyversions: "cp3{6,[1-9][0-9]}-*"
89+
# pattern matches any 2 digit number
90+
pyversions: "cp3[1-9][0-9]-*"
9091
}
9192

9293
- {
@@ -131,19 +132,24 @@ jobs:
131132
export MAC_ARCH="${{ matrix.macarch }}"
132133
brew install pkg-config
133134
cd buildconfig/macdependencies
135+
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
134136
bash ./install_mac_deps.sh
135137
136138
CIBW_BEFORE_BUILD: |
137139
pip install requests numpy Sphinx
138140
python setup.py docs
141+
cp -r ${{ github.workspace }}/pygame_mac_deps_${{ matrix.macarch }} ${{ github.workspace }}/pygame_mac_deps
142+
143+
# To remove any speculations about the wheel not being self-contained
144+
CIBW_BEFORE_TEST: rm -rf ${{ github.workspace }}/pygame_mac_deps
139145

140146
CIBW_TEST_COMMAND: python -m pygame.tests -v --exclude opengl,timing --time_out 300
141147

142148
# Increase pip debugging output
143149
CIBW_BUILD_VERBOSITY: 2
144150

145151
steps:
146-
- uses: actions/checkout@v3.0.2
152+
- uses: actions/checkout@v3.3.0
147153

148154
- name: pip cache
149155
uses: actions/[email protected]
@@ -159,26 +165,10 @@ jobs:
159165
key: macdep-${{ hashFiles('buildconfig/manylinux-build/**') }}-${{ hashFiles('buildconfig/macdependencies/*.sh') }}-${{ matrix.macarch }}
160166

161167
- name: Build and test wheels
162-
uses: pypa/cibuildwheel@v2.10.2
168+
uses: pypa/cibuildwheel@v2.12.0
163169

164170
- uses: actions/upload-artifact@v3
165171
with:
166-
name: pygame-wheels
172+
name: pygame-wheels-macos
167173
path: ./wheelhouse/*.whl
168174

169-
# - name: Upload binaries to Github Releases
170-
# if: github.event_name == 'release'
171-
# uses: svenstaro/upload-release-action@v2
172-
# with:
173-
# repo_token: ${{ secrets.GITHUB_TOKEN }}
174-
# file: ./wheelhouse/*.whl
175-
# tag: ${{ github.ref }}
176-
#
177-
# - name: Upload binaries to PyPI
178-
# if: github.event_name == 'release'
179-
# env:
180-
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
181-
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
182-
# run: |
183-
# python3 -m pip install twine
184-
# twine upload ./wheelhouse/*.whl

.github/workflows/build-manylinux.yml

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ name: ManyLinux
44
# to main. Do not run CI on any other branch. Also, skip any non-source changes
55
# from running on CI
66
on:
7-
release:
8-
types: [created]
97
push:
108
branches: main
119
paths-ignore:
@@ -29,55 +27,39 @@ on:
2927
- '.github/workflows/*.yml'
3028
# re-include current file to not be excluded
3129
- '!.github/workflows/build-manylinux.yml'
30+
31+
# the github release drafter can call this workflow
32+
workflow_call:
3233

3334
concurrency:
34-
group: ${{ github.workflow }}-${{ github.ref }}
35+
group: ${{ github.workflow }}-${{ github.ref }}-manylinux
3536
cancel-in-progress: true
3637

3738
jobs:
3839
build:
39-
name: ${{ matrix.image }} [${{ matrix.arch }}]
40-
runs-on: ubuntu-20.04
40+
name: ${{ matrix.arch }}
41+
runs-on: ubuntu-22.04
42+
permissions:
43+
contents: read
44+
packages: write
45+
4146
strategy:
4247
fail-fast: false # if a particular matrix build fails, don't skip the rest
4348
matrix:
44-
# Split job into many matrix builds, because GH actions provides 20
45-
# concurrent builds on ubuntu. 6 are used here
46-
include:
47-
# no pypy and cpython >= cp310 on manylinux1
48-
- { image: manylinux1, arch: x86_64, pyversions: "cp3[6-9]-*" }
49-
- { image: manylinux1, arch: i686, pyversions: "cp3[6-9]-*" }
50-
51-
# no pypy >= 3.9 and cpython >= cp311 on manylinux2010
52-
- { image: manylinux2010, arch: x86_64, pyversions: "cp3{[6-9],10}-* pp3{7,8}-*" }
53-
- { image: manylinux2010, arch: i686, pyversions: "cp3{[6-9],10}-* pp3{7,8}-*" }
54-
55-
# all cpython and pypy versions should support this for now
56-
# The * here essentially tells cibuildwheel to follow its default behaviour
57-
# of building all possible build configurations the particular cibuildwheel
58-
# version supports. Unless cibuildwheel itself is bumped to the next version,
59-
# this will stay constant and do the same set of builds everytime.
60-
- { image: manylinux2014, arch: x86_64, pyversions: "*" }
61-
- { image: manylinux2014, arch: i686, pyversions: "*" }
62-
49+
arch: [x86_64, i686]
50+
6351
env:
6452
# load pip config from this file. Define this in 'CIBW_ENVIRONMENT'
6553
# because this should not affect cibuildwheel machinery
6654
# also define environment variables needed for testing
6755
CIBW_ENVIRONMENT: PIP_CONFIG_FILE=buildconfig/pip_config.ini PORTMIDI_INC_PORTTIME=1 SDL_VIDEODRIVER=dummy SDL_AUDIODRIVER=disk
6856

69-
CIBW_BUILD: ${{ matrix.pyversions }}
57+
CIBW_BUILD: "cp3{[7-9],10,11}-* pp3[7-9]-*"
7058
CIBW_ARCHS: ${{ matrix.arch }}
7159

7260
# skip musllinux for now
7361
CIBW_SKIP: '*-musllinux_*'
7462

75-
# set custom pygame images
76-
CIBW_MANYLINUX_X86_64_IMAGE: pygame/${{ matrix.image }}_base_x86_64
77-
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: pygame/${{ matrix.image }}_base_x86_64
78-
CIBW_MANYLINUX_I686_IMAGE: pygame/${{ matrix.image }}_base_i686
79-
CIBW_MANYLINUX_PYPY_I686_IMAGE: pygame/${{ matrix.image }}_base_i686
80-
8163
# command that runs before every build
8264
CIBW_BEFORE_BUILD: |
8365
pip install Sphinx
@@ -99,29 +81,49 @@ jobs:
9981
steps:
10082
- uses: actions/[email protected]
10183

84+
- name: Log in to the Container registry
85+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
86+
with:
87+
registry: ghcr.io
88+
username: ${{ github.actor }}
89+
password: ${{ secrets.GITHUB_TOKEN }}
90+
91+
- name: Inspect image, skip build if image exists
92+
id: inspect
93+
continue-on-error: true
94+
run: docker manifest inspect ghcr.io/${{ github.repository }}_${{ matrix.arch }}:${{ hashFiles('buildconfig/manylinux-build/**') }}
95+
96+
- name: Extract metadata (tags, labels) for Docker
97+
id: meta
98+
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
99+
with:
100+
images: ghcr.io/${{ github.repository }}_${{ matrix.arch }}
101+
tags: type=raw,value=${{ hashFiles('buildconfig/manylinux-build/**') }}
102+
103+
- name: Build and push Docker image
104+
if: steps.inspect.outcome == 'failure'
105+
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
106+
with:
107+
context: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base
108+
file: ${{ github.workspace }}/buildconfig/manylinux-build/docker_base/Dockerfile-${{ matrix.arch }}
109+
push: true
110+
tags: ${{ steps.meta.outputs.tags }}
111+
labels: ${{ steps.meta.outputs.labels }}
112+
102113
- name: Build and test wheels
103-
uses: pypa/[email protected]
114+
env:
115+
# set custom pygame images
116+
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/${{ github.repository }}_x86_64:${{ steps.meta.outputs.version }}
117+
CIBW_MANYLINUX_PYPY_X86_64_IMAGE: ghcr.io/${{ github.repository }}_x86_64:${{ steps.meta.outputs.version }}
118+
CIBW_MANYLINUX_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
119+
CIBW_MANYLINUX_PYPY_I686_IMAGE: ghcr.io/${{ github.repository }}_i686:${{ steps.meta.outputs.version }}
120+
121+
uses: pypa/[email protected]
104122

105123
# We upload the generated files under github actions assets
106124
- name: Upload dist
107125
uses: actions/upload-artifact@v3
108126
with:
109-
name: pygame-manylinux-wheels
127+
name: pygame-wheels-manylinux
110128
path: ./wheelhouse/*.whl
111129

112-
# - name: Upload binaries to Github Releases
113-
# if: github.event_name == 'release'
114-
# uses: svenstaro/upload-release-action@v2
115-
# with:
116-
# repo_token: ${{ secrets.GITHUB_TOKEN }}
117-
# file: ./wheelhouse/*.whl
118-
# tag: ${{ github.ref }}
119-
#
120-
# - name: Upload binaries to PyPI
121-
# if: github.event_name == 'release'
122-
# env:
123-
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
124-
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
125-
# run: |
126-
# python3 -m pip install twine
127-
# twine upload ./wheelhouse/*.whl

.github/workflows/build-ubuntu-sdist.yml

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ name: Ubuntu sdist
1111
# to main. Do not run CI on any other branch. Also, skip any non-source changes
1212
# from running on CI
1313
on:
14-
release:
15-
types: [created]
1614
push:
1715
branches: main
1816
paths-ignore:
@@ -36,9 +34,12 @@ on:
3634
- '.github/workflows/*.yml'
3735
# re-include current file to not be excluded
3836
- '!.github/workflows/build-ubuntu-sdist.yml'
37+
38+
# the github release drafter can call this workflow
39+
workflow_call:
3940

4041
concurrency:
41-
group: ${{ github.workflow }}-${{ github.ref }}
42+
group: ${{ github.workflow }}-${{ github.ref }}-ubuntu-sdist
4243
cancel-in-progress: true
4344

4445
jobs:
@@ -47,7 +48,7 @@ jobs:
4748
strategy:
4849
fail-fast: false # if a particular matrix build fails, don't skip the rest
4950
matrix:
50-
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
51+
os: [ubuntu-20.04, ubuntu-22.04]
5152

5253
steps:
5354
- uses: actions/[email protected]
@@ -56,6 +57,7 @@ jobs:
5657
# install numpy from pip and not apt because the one from pip is newer,
5758
# and has typestubs
5859
run: |
60+
sudo apt-mark hold grub-efi-amd64-signed
5961
sudo apt-get update --fix-missing
6062
sudo apt-get upgrade
6163
sudo apt-get install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libfreetype6-dev libportmidi-dev libjpeg-dev python3-setuptools python3-dev
@@ -86,22 +88,6 @@ jobs:
8688
if: matrix.os == 'ubuntu-20.04' # upload sdist only once
8789
uses: actions/upload-artifact@v3
8890
with:
89-
name: pygame-sdist
91+
name: pygame-wheels-sdist
9092
path: dist/*.tar.gz
9193

92-
# - name: Upload binaries to Github Releases
93-
# if: github.event_name == 'release' && matrix.os == 'ubuntu-20.04' # upload sdist only once
94-
# uses: svenstaro/upload-release-action@v2
95-
# with:
96-
# repo_token: ${{ secrets.GITHUB_TOKEN }}
97-
# file: dist/*.tar.gz
98-
# tag: ${{ github.ref }}
99-
#
100-
# - name: Upload binaries to PyPI
101-
# if: github.event_name == 'release' && matrix.os == 'ubuntu-20.04' # upload sdist only once
102-
# env:
103-
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
104-
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
105-
# run: |
106-
# python3 -m pip install twine
107-
# twine upload dist/*.tar.gz

0 commit comments

Comments
 (0)