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 workflow for publishing releases to PyPI #21

Merged
merged 8 commits into from
Aug 30, 2024
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
37 changes: 37 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish release to PyPI

on:
release:
types: [created]

jobs:
pypi-publish:
name: Publish release to PyPI
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/mcclient-lib
permissions:
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build setuptools-scm

- name: Build package
run: python -m build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61.0"]
requires = ["setuptools>=61.0", "setuptools_scm>=8"]

[project]
authors = [{ name = "Sch8ill", email = "noreply@noreply.com" },
]
dynamic = ["version"]
classifiers = ["Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
dependencies = ["dnspython>=2.2.1",
]
dependencies = ["dnspython>=2.2.1"]
description = "A lightweight Minecraft client for querying the status data of a Minecraft server."
name = "mcclient-lib"
readme = "README.md"
requires-python = ">=3.7"
version = "1.2.0"

[project.urls]
"Bug Tracker" = "https://github.com/sch8ill/mcclient-lib/issues"
"Homepage" = "https://github.com/Sch8ill/mcclient-lib"
"Homepage" = "https://github.com/sch8ill/mcclient-lib"

[tool.pytest.ini_options]
addopts = "--cov=mcclient --ignore=examples"
Expand All @@ -28,3 +27,6 @@ minversion = "6.0"
[tool.mypy]
check_untyped_defs = true
exclude = ["tests"]

[tool.setuptools_scm]
version_scheme = "post-release"
Loading