Skip to content

Commit

Permalink
Merge pull request #94 from CodethinkLabs/bobclough/packaging-push
Browse files Browse the repository at this point in the history
Packaging / Release Action
  • Loading branch information
thinkl33t authored Dec 5, 2023
2 parents 0a99722 + 899ce5e commit 05b78a1
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 3 deletions.
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]

0 comments on commit 05b78a1

Please sign in to comment.