Skip to content

Commit

Permalink
Update github actions and add Python 3.13 (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p authored Oct 6, 2024
1 parent 1499fa9 commit 942f15b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.21.2
env:
CIBW_SKIP: pp*
CIBW_TEST_COMMAND: python -m unittest discover ephem
Expand Down
35 changes: 25 additions & 10 deletions .github/workflows/github-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,31 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'

- name: Generate build name for artifact upload
id: build-name
run: |
name=""
if [[ -n "${{ matrix.build }}" ]]; then
name="-$(echo ${{ matrix.build }} | tr -d *-_)"
fi
echo "name: ${name}"
echo "name=${name}" >> $GITHUB_OUTPUT
# https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
# offers this stanza plus “CIBW_ARCHS_LINUX” below:
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
uses: pypa/cibuildwheel@v2.21.2
env:
CIBW_ARCHS: ${{ matrix.arch }}
CIBW_BUILD: ${{ matrix.build }}
Expand All @@ -75,40 +85,45 @@ jobs:
CIBW_TEST_REQUIRES: tzdata
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}-${{ matrix.arch }}${{ steps.build-name.outputs.name }}
path: ./wheelhouse/*.whl
overwrite: true

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: '3.8'

- name: Build sdist
run: python setup.py sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: wheels-sdist
path: dist/*.tar.gz
overwrite: true

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
pattern: wheels-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@master
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
skip-existing: true
user: __token__
password: ${{ secrets.pypi_password }}
# To test: repository_url: https://test.pypi.org/legacy/
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
packages = [ 'ephem', 'ephem.tests' ],
package_data = { 'ephem': ['doc/*.rst',
Expand Down

0 comments on commit 942f15b

Please sign in to comment.