-
Notifications
You must be signed in to change notification settings - Fork 12
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 #173 from asmeurer/release
1.8 release
- Loading branch information
Showing
10 changed files
with
209 additions
and
92 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,115 @@ | ||
name: publish distributions | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '[0-9]+.[0-9]+' | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
pull_request: | ||
branches: | ||
- main | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
inputs: | ||
publish: | ||
type: choice | ||
description: 'Publish to TestPyPI?' | ||
options: | ||
- false | ||
- true | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
name: Build Python distribution | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install python-build and twine | ||
run: | | ||
python -m pip install --upgrade pip setuptools | ||
python -m pip install build twine | ||
python -m pip list | ||
- name: Install dependencies | ||
run: python -m pip install -r requirements-dev.txt | ||
|
||
- name: Build a wheel and a sdist | ||
run: | | ||
CYTHONIZE_NDINDEX=0 PYTHONWARNINGS=error,default::DeprecationWarning python -m build . | ||
- name: Verify the distribution | ||
run: twine check --strict dist/* | ||
|
||
- name: List contents of sdist | ||
run: python -m tarfile --list dist/ndindex-*.tar.gz | ||
|
||
- name: List contents of wheel | ||
run: python -m zipfile --list dist/ndindex-*.whl | ||
|
||
- name: Upload distribution artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: dist-artifact | ||
path: dist | ||
|
||
publish: | ||
name: Publish Python distribution to (Test)PyPI | ||
if: github.event_name != 'pull_request' && github.repository == 'Quansight-Labs/ndindex' | ||
needs: build | ||
runs-on: ubuntu-latest | ||
# Mandatory for publishing with a trusted publisher | ||
# c.f. https://docs.pypi.org/trusted-publishers/using-a-publisher/ | ||
permissions: | ||
id-token: write | ||
contents: write | ||
# Restrict to the environment set for the trusted publisher | ||
environment: | ||
name: publish-package | ||
|
||
steps: | ||
- name: Download distribution artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: dist-artifact | ||
path: dist | ||
|
||
- name: List all files | ||
run: ls -lh dist | ||
|
||
- name: Publish distribution 📦 to Test PyPI | ||
# Publish to TestPyPI on tag events of if manually triggered | ||
# Compare to 'true' string as booleans get turned into strings in the console | ||
if: >- | ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags')) | ||
|| (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true') | ||
uses: pypa/gh-action-pypi-publish@v1.8.11 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
print-hash: true | ||
|
||
- name: Create GitHub Release from a Tag | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: dist/* | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@v1.8.11 | ||
with: | ||
print-hash: true |
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
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ linkify-it-py | |
myst-parser | ||
sphinx | ||
sphinx-copybutton | ||
sphinx-autobuild |
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
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
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