Skip to content

Commit 7a2fd8c

Browse files
committed
Stop being a dumb human trying to publish this manually
- Add gh publish action - Fix up the make build target - Bump VERSION - Closes #131
1 parent 3102727 commit 7a2fd8c

4 files changed

Lines changed: 42 additions & 4 deletions

File tree

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
env:
11+
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
12+
steps:
13+
- uses: actions/checkout@v6.0.2
14+
- uses: actions/setup-python@v6.2.0
15+
with:
16+
python-version: "3.12"
17+
- name: Build package
18+
run: pip install build && python -m build
19+
- name: Upload dist artifacts
20+
uses: actions/upload-artifact@v4
21+
with:
22+
name: dist
23+
path: dist/
24+
25+
publish:
26+
needs: build
27+
runs-on: ubuntu-latest
28+
environment: pypi
29+
permissions:
30+
id-token: write
31+
steps:
32+
- name: Download dist artifacts
33+
uses: actions/download-artifact@v4
34+
with:
35+
name: dist
36+
path: dist/
37+
- name: Publish to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ viewcover: ci-unittests
9494
xdg-open htmlcov/index.html; \
9595
fi
9696

97-
build: clean
97+
build: clean virtualenv
9898
@echo "#############################################"
9999
@echo "# Building sdist + wheel"
100100
@echo "#############################################"
101-
. $(NAME)env3/bin/activate && python -m build
101+
. $(NAME)env3/bin/activate && pip install build && python -m build
102102

103103
pypi: build
104104
@echo "#############################################"

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.0.0
1+
2.0.1

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "bitmath"
7-
version = "2.0.0"
7+
version = "2.0.1"
88
description = "Pythonic module for representing and manipulating file sizes with different prefix notations (file size unit conversion)"
99
readme = "README.rst"
1010
requires-python = ">=3.9"

0 commit comments

Comments
 (0)