Skip to content

Commit 0da3ebc

Browse files
authored
Merge pull request #48 from michalc/build/publish-pypi-github-actions
build: publish to PyPI from GitHub actions
2 parents 73d869c + dee149c commit 0da3ebc

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish to PyPI
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
11+
- uses: actions/setup-python@v3
12+
with:
13+
python-version: 3.11
14+
15+
- name: Update version in pyproject.toml from current git tag
16+
run: >-
17+
sed -i "s/0\\.0\\.0\\.dev0/${GITHUB_REF/refs\/tags\/v/}/g" setup.py
18+
19+
- run: |
20+
pip install build
21+
python -m build
22+
23+
- uses: actions/upload-artifact@v3
24+
with:
25+
path: ./dist
26+
27+
pypi-publish:
28+
needs: ['build']
29+
environment: 'publish-pypi'
30+
31+
name: upload release to PyPI
32+
runs-on: ubuntu-latest
33+
permissions:
34+
id-token: write
35+
steps:
36+
- uses: actions/download-artifact@v3
37+
38+
- name: Publish package distributions to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
packages_dir: artifact/

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 = "sqlite-s3-query"
7-
version = "0.0.74"
7+
version = "0.0.0.dev0"
88
authors = [
99
{ name="Michal Charemza", email="michal@charemza.name" },
1010
]

0 commit comments

Comments
 (0)