-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from mithro/github-actions
Add GitHub Actions which publish to PyPI
- Loading branch information
Showing
11 changed files
with
426 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
# Remove the ancient version of cmake | ||
yum remove cmake -y | ||
|
||
# Add in curl | ||
yum install wget -y | ||
|
||
yum install java-1.8.0-openjdk uuid uuid-devel libuuid libuuid-devel -y | ||
|
||
# Download new cmake | ||
wget https://github.com/Kitware/CMake/releases/download/v3.19.4/cmake-3.19.4-Linux-x86_64.sh -O /tmp/cmake.sh | ||
chmod a+x /tmp/cmake.sh | ||
|
||
# Install cmake into /usr | ||
/tmp/cmake.sh --prefix=/usr --skip-license |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,200 @@ | ||
name: PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- github-actions | ||
|
||
jobs: | ||
|
||
Source: | ||
runs-on: ubuntu-20.04 | ||
name: Source | ||
|
||
steps: | ||
- name: 🧰 Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# Always clone the full depth so git-describe works. | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Install dependencies (Ubuntu) | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y cmake default-jre-headless uuid-dev libantlr4-runtime-dev | ||
- name: 🐍 Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Install build dependencies | ||
run: | | ||
pip install -U pip | ||
pip install -r requirements.txt | ||
- name: Install package dependencies | ||
run: | | ||
python setup.py install | ||
- name: 🚧 Build distribution 📦 | ||
run: | | ||
python setup.py sdist | ||
- name: Check distribution 📦 | ||
run: | | ||
twine check dist/* | ||
- name: 📤 Publish source to Test PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }} | ||
run: | | ||
twine upload --skip-existing --verbose --repository testpypi dist/*.tar.gz | ||
# - name: 📤 Publish source to PyPI | ||
# env: | ||
# TWINE_USERNAME: __token__ | ||
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
# run: | | ||
# twine upload dist/*.tar.gz | ||
|
||
Linux: | ||
strategy: | ||
matrix: | ||
python-version: [ 'cp36-cp36m', 'cp37-cp37m', 'cp38-cp38', 'cp39-cp39' ] | ||
fail-fast: false | ||
|
||
name: ${{ matrix.python-version }} • manylinux | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: 🧰 Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# Always clone the full depth so git-describe works. | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: 🐍 Set up Python | ||
uses: actions/setup-python@v2 | ||
|
||
- name: Install build dependencies | ||
run: | | ||
pip install -U pip | ||
pip install twine auditwheel | ||
- name: 🚧 Build distribution 📦 | ||
uses: RalfG/[email protected]_x86_64 | ||
with: | ||
build-requirements: 'cython' | ||
pre-build-command: 'bash .github/workflows/manylinux-install-cmake.sh' | ||
python-versions: ${{ matrix.python-version }} | ||
#pip-wheel-args: '-w ./dist --no-deps --verbose' | ||
|
||
- name: List distribution 📦 | ||
run: | | ||
set -x | ||
ls -l dist/* | ||
echo $USER | ||
whoami | ||
sudo chown -R $USER dist | ||
ls -l dist/* | ||
rm -v dist/*linux_x86_64*.whl | ||
ls -l dist/* | ||
- name: Check distribution 📦 | ||
run: | | ||
for WHEEL in dist/*.whl; do | ||
echo | ||
echo "::group::Checking $WHEEL" | ||
echo | ||
python -m zipfile --list $WHEEL | ||
echo | ||
auditwheel show $WHEEL | ||
echo | ||
twine check $WHEEL | ||
echo | ||
echo "::endgroup::" | ||
done | ||
- name: 📤 Publish wheels to Test PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }} | ||
run: | | ||
twine upload --skip-existing --verbose --repository testpypi dist/*.whl | ||
# - name: 📤 Publish wheels to PyPI | ||
# env: | ||
# TWINE_USERNAME: __token__ | ||
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
# run: | | ||
# twine upload dist/*.whl | ||
|
||
MacAndWindows: | ||
strategy: | ||
matrix: | ||
python-version: [ '3.6', '3.7', '3.8', '3.9', 'pypy-3.6', 'pypy-3.7' ] | ||
os: [windows-latest, macos-latest] | ||
fail-fast: false | ||
|
||
name: ${{ matrix.python-version }} • ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: 🧰 Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
# Always clone the full depth so git-describe works. | ||
fetch-depth: 0 | ||
submodules: true | ||
|
||
- name: Install dependencies (Mac OS X) | ||
if: startsWith(matrix.os, 'macos') | ||
run: | | ||
true | ||
- name: Install dependencies (Windows) | ||
if: startsWith(matrix.os, 'windows') | ||
run: | | ||
true | ||
- name: 🐍 Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install build dependencies | ||
run: | | ||
pip install -U pip | ||
pip install -r requirements.txt | ||
- name: Install package dependencies | ||
run: | | ||
python setup.py install | ||
- name: 🚧 Build distribution 📦 | ||
run: | | ||
python setup.py bdist_wheel | ||
- name: Check distribution 📦 | ||
run: | | ||
python -m zipfile -l dist/* | ||
twine check dist/* | ||
- name: 📤 Publish wheels to Test PyPI | ||
env: | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }} | ||
run: | | ||
twine upload --skip-existing --verbose --repository testpypi dist/*.whl | ||
# - name: 📤 Publish wheels to PyPI | ||
# env: | ||
# TWINE_USERNAME: __token__ | ||
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
# run: | | ||
# twine upload dist/*.whl |
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
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
Oops, something went wrong.