Skip to content

Commit fe65965

Browse files
authored
Add release workflow, dynamic versioning (#30)
This PR: - replaces the static version with a dynamic versioning plugin that assigns versions based on git sha - adds a release.yml that will publish to pypi when a new GitHub release is published Once we merge this we should create a git tag for 0.2.0 at the sha where that version was bumped.
1 parent 632acb6 commit fe65965

File tree

2 files changed

+49
-3
lines changed

2 files changed

+49
-3
lines changed

.github/workflows/release.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release to PyPI
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-22.04
11+
12+
# Add "id-token" with the intended permissions.
13+
permissions:
14+
contents: 'read'
15+
id-token: 'write'
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
# This is here so that the versioning plugin will be able to see tags
21+
# and version using them.
22+
fetch-depth: 0
23+
24+
- uses: actions/setup-python@v4
25+
with:
26+
python-version: 3.11.5
27+
28+
29+
- name: Install and configure Poetry
30+
uses: snok/install-poetry@v1
31+
32+
- name: Configure deploy keys
33+
run: |
34+
poetry config pypi-token.pypi ${{ secrets.PYPI_API_KEY }}
35+
36+
- name: Install deps
37+
run: poetry install
38+
39+
- name: Deploy to PyPI
40+
run: poetry publish --build

pyproject.toml

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "hfppl"
3-
version = "0.2.0"
3+
version = "0.0.0"
44
description = "Probabilistic programming with HuggingFace Transformer models."
55
authors = [
66
"Alex Lew <[email protected]>",
@@ -55,5 +55,11 @@ evaluate = "^0.4.2"
5555
examples=["nltk"]
5656

5757
[build-system]
58-
requires = ["poetry-core"]
59-
build-backend = "poetry.core.masonry.api"
58+
requires = ["poetry-core>=1.0.0", "poetry-dynamic-versioning>=1.0.0,<2.0.0"]
59+
build-backend = "poetry_dynamic_versioning.backend"
60+
61+
[tool.poetry.requires-plugins]
62+
poetry-dynamic-versioning = { version = ">=1.0.0,<2.0.0", extras = ["plugin"] }
63+
64+
[tool.poetry-dynamic-versioning]
65+
enable = true

0 commit comments

Comments
 (0)