Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add release action and GH -> PyPI trusted publisher #158

Merged
merged 5 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
- pre-commit-ci
categories:
- title: API Changes
labels:
- api
- title: Enhancements
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Deprecations
labels:
- deprecation
- title: Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"
42 changes: 42 additions & 0 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Publish neatnet to PyPI / GitHub

on:
push:
tags:
- "v*"

jobs:
build-n-publish:
name: Build and publish neatnet to PyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"

- name: Build source and wheel distributions
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*

- name: Create Release Notes
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.6"
rev: "v0.9.1"
hooks:
- id: ruff
files: "neatnet\/"
Expand Down
3 changes: 1 addition & 2 deletions neatnet/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -1542,8 +1542,7 @@ def nx_gx_cluster(
conn_within = _is_within(non_planar_connections, cluster_geom)
if not all(conn_within):
warnings.warn(
"Could not create a connection as it would lead outside "
"of the artifact.",
"Could not create a connection as it would lead outside of the artifact.",
UserWarning,
stacklevel=2,
)
Expand Down
Loading