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

Packaging / Release Action #94

Merged
merged 2 commits into from
Dec 5, 2023
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
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish to PyPI on tagging

on: push

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ct-lifecycle
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
# checkout full tree
fetch-depth: 0

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install pypa/build
run: >-
python -m
pip install
build
--user

- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.

- name: Publish to test PyPI always
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPI on tag
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
author = "Codethink Ltd"

release = "0.1"
version = "0.1.0"
version = "0.1.1"

# -- General configuration

Expand Down
2 changes: 2 additions & 0 deletions lifecycle/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""Lifecycle management namespace"""

__version__ = "0.1.1"

from abc import ABC, abstractmethod
from collections.abc import Mapping
import logging
Expand Down
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ build-backend = "setuptools.build_meta"
[project]
name = "ct_lifecycle"
description = "Assert the SSOT principle for users and groups across disparate applications and services."
readme = "README.md"
requires-python = ">=3.9"
license = {text = "MIT"}
classifiers = [
"Programming Language :: Python :: 3",
]
dynamic = ["version"]
dynamic = ["version", "readme", "scripts", "dependencies", "optional-dependencies"]

[tool.setuptools.dynamic]
readme = {file = ["README.md"], content-type = "text/markdown"}
version = {attr = "lifecycle.__version__"}

[tool.setuptools_scm]
Loading