Skip to content

Commit 033ebbd

Browse files
committed
chore: bump version to 0.1.0 for initial release
- Add GitHub Actions publish workflow for PyPI and Test PyPI - Set up trusted publishing via OIDC (id-token: write)
1 parent a478ee1 commit 033ebbd

4 files changed

Lines changed: 95 additions & 3 deletions

File tree

.github/workflows/publish.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: PyPI release
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [main]
7+
push:
8+
branches: [main]
9+
release:
10+
types: [published]
11+
12+
permissions: {}
13+
14+
jobs:
15+
build:
16+
name: Build source distribution
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
persist-credentials: false
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v8.2.0
27+
- name: Build the sdist and the wheel
28+
run: uv build
29+
- name: Check the sdist installs and imports
30+
run: |
31+
uv tool run --from venv --with venv -- python -m venv venv-sdist
32+
venv-sdist/bin/python -m pip install dist/tidydraws*.tar.gz
33+
echo "Checking import and version number (on release)"
34+
venv-sdist/bin/python -c "import tidydraws; assert tidydraws.__version__ == '${REF_NAME}' if '${REF_TYPE}' == 'tag' else tidydraws.__version__; print(tidydraws.__version__)"
35+
env:
36+
REF_NAME: ${{ github.ref_name }}
37+
REF_TYPE: ${{ github.ref_type }}
38+
- name: Check the bdist installs and imports
39+
run: |
40+
python -m venv venv-bdist
41+
venv-bdist/bin/python -m pip install dist/tidydraws*.whl
42+
echo "Checking import and version number (on release)"
43+
venv-bdist/bin/python -c "import tidydraws; assert tidydraws.__version__ == '${REF_NAME}' if '${REF_TYPE}' == 'tag' else tidydraws.__version__; print(tidydraws.__version__)"
44+
env:
45+
REF_NAME: ${{ github.ref_name }}
46+
REF_TYPE: ${{ github.ref_type }}
47+
- uses: actions/upload-artifact@v4
48+
with:
49+
name: artifact
50+
path: dist/*
51+
52+
test-publish:
53+
name: Upload to Test PyPI
54+
permissions:
55+
id-token: write
56+
needs: [build]
57+
runs-on: ubuntu-latest
58+
if: github.event_name == 'release' && github.event.action == 'published'
59+
steps:
60+
- uses: actions/download-artifact@v4
61+
with:
62+
name: artifact
63+
path: dist
64+
- uses: pypa/gh-action-pypi-publish@v1.14.0
65+
with:
66+
skip_existing: true
67+
repository_url: https://test.pypi.org/legacy/
68+
- name: Test pip install from test.pypi
69+
run: |
70+
sleep 5s
71+
python -m venv venv-test-pypi
72+
venv-test-pypi/bin/python -m pip install \
73+
--index-url https://test.pypi.org/simple/ \
74+
--extra-index-url https://pypi.org/simple \
75+
tidydraws
76+
echo "Checking import and version number"
77+
venv-test-pypi/bin/python -c "import tidydraws; print(tidydraws.__version__)"
78+
79+
publish:
80+
environment: release
81+
permissions:
82+
id-token: write
83+
name: Upload release to PyPI
84+
needs: [build, test-publish]
85+
runs-on: ubuntu-latest
86+
if: github.event_name == 'release' && github.event.action == 'published'
87+
steps:
88+
- uses: actions/download-artifact@v4
89+
with:
90+
name: artifact
91+
path: dist
92+
- uses: pypa/gh-action-pypi-publish@v1.14.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "tidydraws"
3-
version = "0.1.0a0"
3+
version = "0.1.0"
44
description = "A tidybayes-inspired data layer for declarative Bayesian visualisation in Python"
55
readme = "README.md"
66
license = { text = "MIT" }

tidydraws/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""tidydraws — A tidybayes-inspired data layer for declarative Bayesian visualisation in Python."""
22

3-
__version__ = "0.1.0a0"
3+
__version__ = "0.1.0"
44
from ._extract import parameter_draws as parameter_draws
55
from ._extract import prediction_draws as prediction_draws
66
from ._extract import compare_draws as compare_draws

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)