Skip to content

Commit 91f152d

Browse files
pypi uploading
1 parent d73ae46 commit 91f152d

File tree

2 files changed

+87
-4
lines changed

2 files changed

+87
-4
lines changed

.github/workflows/build.yml

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ on:
88

99
# Allows you to run this workflow manually from the Actions tab
1010
workflow_dispatch:
11-
11+
inputs:
12+
publish_to_pypi:
13+
description: 'Publish to PyPI?'
14+
type: boolean
15+
required: true
16+
default: false
1217

1318
jobs:
1419
build-mac-intel:
@@ -110,6 +115,12 @@ jobs:
110115
exit 1
111116
fi
112117
118+
- name: Publish to PyPI
119+
if: ${{ inputs.publish_to_pypi == true }}
120+
run: |
121+
python3 -m pip install twine
122+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} dist/*.whl
123+
113124
- name: Upload build Artifact wheel
114125
uses: actions/upload-artifact@v4
115126
with:
@@ -216,6 +227,12 @@ jobs:
216227
done
217228
shell: bash
218229

230+
- name: Publish to PyPI
231+
if: ${{ inputs.publish_to_pypi == true }}
232+
run: |
233+
python3 -m pip install twine
234+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} dist/*.whl
235+
219236
- name: Upload build Artifact wheel
220237
uses: actions/upload-artifact@v4
221238
with:
@@ -337,6 +354,13 @@ jobs:
337354
echo "Failed"
338355
exit 1
339356
fi
357+
358+
- name: Publish to PyPI
359+
if: ${{ inputs.publish_to_pypi == true }}
360+
run: |
361+
python3 -m pip install twine
362+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} wheelhouse/*.whl
363+
340364
- name: Upload build Artifact wheel
341365
uses: actions/upload-artifact@v4
342366
with:
@@ -453,6 +477,13 @@ jobs:
453477
echo "Failed"
454478
exit 1
455479
fi
480+
481+
- name: Publish to PyPI
482+
if: ${{ inputs.publish_to_pypi == true }}
483+
run: |
484+
python3 -m pip install twine
485+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} wheelhouse/*.whl
486+
456487
- name: Upload build Artifact wheel
457488
uses: actions/upload-artifact@v4
458489
with:
@@ -565,6 +596,13 @@ jobs:
565596
echo "Failed"
566597
exit 1
567598
fi
599+
600+
- name: Publish to PyPI
601+
if: ${{ inputs.publish_to_pypi == true }}
602+
run: |
603+
python3 -m pip install twine
604+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} wheelhouse/*.whl
605+
568606
- name: Upload build Artifact wheel
569607
uses: actions/upload-artifact@v4
570608
with:
@@ -673,6 +711,12 @@ jobs:
673711
echo "Failed"
674712
exit 1
675713
fi
714+
715+
- name: Publish to PyPI
716+
if: ${{ inputs.publish_to_pypi == true }}
717+
run: |
718+
python3 -m pip install twine
719+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} dist/*.whl
676720
677721
- name: Upload build Artifact wheel
678722
uses: actions/upload-artifact@v4
@@ -688,7 +732,7 @@ jobs:
688732
# For example, pypy2 and pypy3
689733
matrix:
690734
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14' ]
691-
raylib-platform: [ 'Desktop', 'SDL' ]
735+
raylib-platform: [ 'Desktop', 'SDL', 'SDL_SOFT']
692736
steps:
693737
- uses: actions/checkout@v4
694738
with:
@@ -731,9 +775,22 @@ jobs:
731775
cd raylib-c
732776
mkdir build
733777
cd build
734-
cmake -A Win32 -DPLATFORM=${{ matrix.raylib-platform }} -DOPENGL_VERSION=2.1 -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
778+
PLATFORM="${{ matrix.raylib-platform }}"
779+
if [ ${{ matrix.raylib-platform }} = "SDL_SOFT" ]; then
780+
OPENGL="Software"
781+
PLATFORM="SDL"
782+
else
783+
OPENGL="2.1"
784+
fi
785+
echo "OPENGL $OPENGL PLATFORM $PLATFORM"
786+
cmake -A Win32 -DPLATFORM="$PLATFORM" -DOPENGL_VERSION="$OPENGL" -DBUILD_EXAMPLES=OFF -DCUSTOMIZE_BUILD=ON -DSUPPORT_FILEFORMAT_JPG=ON -DSUPPORT_FILEFORMAT_FLAC=ON -DWITH_PIC=ON -DCMAKE_BUILD_TYPE=Release ..
787+
shell: bash
788+
789+
- name: Build raylib2
790+
run: |
791+
cd raylib-c/build
735792
msbuild raylib.sln /target:raylib /property:Configuration=Release
736-
copy raylib\Release\raylib.lib ..\..
793+
cp raylib\Release\raylib.lib ..\..
737794
cd ..\..
738795
shell: cmd
739796

@@ -770,6 +827,12 @@ jobs:
770827
exit 1
771828
fi
772829
830+
- name: Publish to PyPI
831+
if: ${{ inputs.publish_to_pypi == true }}
832+
run: |
833+
python3 -m pip install twine
834+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} dist/*.whl
835+
773836
- name: Upload build Artifact wheel
774837
uses: actions/upload-artifact@v4
775838
with:
@@ -821,6 +884,12 @@ jobs:
821884
pip3 install --upgrade setuptools
822885
python setup.py sdist
823886
887+
- name: Publish to PyPI
888+
if: ${{ inputs.publish_to_pypi == true }}
889+
run: |
890+
python3 -m pip install twine
891+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} dist/*
892+
824893
- name: Upload build Artifact wheel
825894
uses: actions/upload-artifact@v4
826895
with:
@@ -857,6 +926,12 @@ jobs:
857926
cd dynamic
858927
python setup.py sdist
859928
929+
- name: Publish to PyPI
930+
if: ${{ inputs.publish_to_pypi == true }}
931+
run: |
932+
python3 -m pip install twine
933+
python3 -m twine upload -u __token__ -p ${{ secrets.PYPI_KEY }} dynamic/dist/*
934+
860935
- name: Upload build Artifact wheel
861936
uses: actions/upload-artifact@v4
862937
with:
@@ -868,6 +943,7 @@ jobs:
868943
runs-on: ubuntu-latest
869944
steps:
870945
- name: Merge All Artifacts
946+
if: ${{ inputs.publish_to_pypi == false }}
871947
uses: actions/upload-artifact/merge@v4
872948
with:
873949
name: wheel

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
RAYLIB_PLATFORM = os.getenv("RAYLIB_PLATFORM", "Desktop")
1414
if RAYLIB_PLATFORM == "SDL":
1515
NAME = "_sdl"
16+
if RAYLIB_PLATFORM == "SDL_SOFT":
17+
NAME = "_software"
1618
elif RAYLIB_PLATFORM == "DRM":
1719
NAME = "_drm"
1820
else:
@@ -38,6 +40,11 @@ def has_ext_modules(foo):
3840
"Programming Language :: Python :: 3.14",
3941
"Programming Language :: Python :: 3.13",
4042
"Programming Language :: Python :: 3.12",
43+
"Programming Language :: Python :: 3.11",
44+
"Programming Language :: Python :: 3.10",
45+
"Programming Language :: Python :: 3.9",
46+
"Programming Language :: Python :: 3.8",
47+
"Programming Language :: Python :: 3.7"
4148
],
4249
packages=["raylib", "pyray"],
4350
include_package_data=True,

0 commit comments

Comments
 (0)