-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- bring back PyPi workflow it got dropped somehow.
- Loading branch information
1 parent
01afd4a
commit 6c21ca8
Showing
4 changed files
with
90 additions
and
155 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 |
---|---|---|
@@ -1,49 +1,109 @@ | ||
# Refer to the following link for help | ||
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
|
||
name: "Pull Request Sphinx Docs Check" | ||
|
||
name: PyPI Distributions | ||
concurrency: build_and_publish_to_pypi | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
sphinx_docs_build: | ||
runs-on: ubuntu-latest | ||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-14, macos-15] | ||
|
||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.11 env for sphinx... | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install Build Requirements | ||
- name: Install cibuildwheel | ||
run: | | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Build wheels using cibuildwheel | ||
uses: carlkidcrypto/[email protected] | ||
with: | ||
linux: | | ||
sudo apt install -y libsnmp-dev g++ python3-dev; | ||
cd /home/runner/work/ezsnmp/ezsnmp/ && | ||
python -m pip install . --user; | ||
linux: python -m cibuildwheel --output-dir wheelhouse --platform linux; | ||
|
||
macos: | | ||
MACOS_VERSION=$(sw_vers -productVersion) | ||
if [[ "$MACOS_VERSION" == "10.15."* ]]; then | ||
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\110.15"/' pyproject.toml | ||
elif [[ "$MACOS_VERSION" == "11."* ]]; then | ||
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\111.0"/' pyproject.toml | ||
elif [[ "$MACOS_VERSION" == "12."* ]]; then | ||
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\112.0"/' pyproject.toml | ||
elif [[ "$MACOS_VERSION" == "13."* ]]; then | ||
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\113.0"/' pyproject.toml | ||
elif [[ "$MACOS_VERSION" == "14."* ]]; then | ||
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\114.0"/' pyproject.toml | ||
elif [[ "$MACOS_VERSION" == "15."* ]]; then | ||
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\115.0"/' pyproject.toml | ||
else | ||
sed -i '' 's/\(MACOSX_DEPLOYMENT_TARGET = "\)[^"]*"/\110.15"/' pyproject.toml | ||
fi | ||
python -m cibuildwheel --output-dir wheelhouse --platform macos; | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
path: wheelhouse/*.whl | ||
|
||
- name: Run sphinx... | ||
build-n-publish-pypi: | ||
name: Build and Publish To PyPi | ||
runs-on: ubuntu-latest | ||
needs: build_wheels | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Set up dependencies | ||
uses: carlkidcrypto/[email protected] | ||
with: | ||
linux: | | ||
cd /home/runner/work/ezsnmp/ezsnmp/sphinx_docs_build; | ||
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi | ||
mkdir source/_static; | ||
mkdir source/_templates; | ||
make clean && make html SPHINXOPTS="-W" | ||
- name: Upload Release Asset | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
linux: sudo apt-get update; | ||
sudo apt-get install -y libsnmp-dev libperl-dev; | ||
|
||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--outdir dist/ | ||
. | ||
- name: Download Wheels | ||
uses: actions/download-artifact@v4 | ||
with: | ||
pattern: cibw-wheels-* | ||
merge-multiple: true | ||
path: dist/ | ||
|
||
- name: Publish distribution 📦 to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.6 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./sphinx_docs_build/build/html/ | ||
asset_name: documentation.zip | ||
asset_content_type: application/zip | ||
print_hash: true | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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
123 changes: 0 additions & 123 deletions
123
docs/htmll/_static/_sphinx_javascript_frameworks_compat.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.