Skip to content

Commit a4d4e36

Browse files
authored
Merge pull request #20 from ChiSym/sritchie/release_workflow
Add release action, dynamic versioning
2 parents cf1d091 + 69db5b5 commit a4d4e36

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release to Artifact Registry
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+
cache: 'pip'
28+
29+
- name: Build package
30+
run: |
31+
python3 -m pip install --upgrade build
32+
python3 -m build
33+
34+
- name: Publish to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "genlm-backend"
3-
version = "0.0.1"
3+
dynamic = ["version"]
44
description = ""
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -41,5 +41,7 @@ docs = [
4141
include = ["*"]
4242

4343
[build-system]
44-
requires = ["setuptools>=61.0"]
44+
requires = ["setuptools>=64.0", "setuptools-scm>=8"]
4545
build-backend = "setuptools.build_meta"
46+
47+
[tool.setuptools_scm]

0 commit comments

Comments
 (0)