Skip to content

Commit ef54636

Browse files
committed
ci: added pypi upload
1 parent 9e4a154 commit ef54636

5 files changed

Lines changed: 106 additions & 1 deletion

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Patch Release
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
name: "Bump minor version and create changelog with commitizen"
11+
steps:
12+
- name: Check out
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
token: "${{ secrets.GITHUB_TOKEN }}"
17+
- id: cz
18+
name: Create bump and changelog
19+
uses: commitizen-tools/commitizen-action@master
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
changelog_increment_filename: body.md
23+
increment: PATCH
24+
- name: Release
25+
uses: ncipollo/release-action@v1
26+
with:
27+
tag: v${{ env.REVISION }}
28+
bodyFile: "body.md"
29+
skipIfReleaseExists: true
30+
- name: Print Version
31+
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"

.github/workflows/pipeline.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,27 @@ jobs:
2727
# run: make lint
2828
- name: Tests
2929
run: make test
30+
31+
- name: Build sdist and wheel
32+
run: python -m build
33+
34+
- uses: actions/upload-artifact@v4
35+
with:
36+
name: python-package-distributions
37+
path: dist/
38+
39+
upload_pypi:
40+
needs: [build_dist]
41+
runs-on: ubuntu-latest
42+
# Upload to PyPI on release
43+
if: always() && github.event_name == 'release' && github.event.action == 'published'
44+
environment: pypi
45+
permissions:
46+
id-token: write
47+
steps:
48+
- uses: actions/download-artifact@v4
49+
with:
50+
name: python-package-distributions
51+
path: dist
52+
53+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/release.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
name: "Bump version and create changelog with commitizen"
11+
steps:
12+
- name: Check out
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
token: "${{ secrets.GITHUB_TOKEN }}"
17+
- id: cz
18+
name: Create bump and changelog
19+
uses: commitizen-tools/commitizen-action@master
20+
with:
21+
github_token: ${{ secrets.GITHUB_TOKEN }}
22+
changelog_increment_filename: body.md
23+
- name: Release
24+
uses: ncipollo/release-action@v1
25+
with:
26+
tag: v${{ env.REVISION }}
27+
bodyFile: "body.md"
28+
skipIfReleaseExists: true
29+
- name: Print Version
30+
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ mypy:
2020
test:
2121
pytest ${PYSRC} -vv
2222

23+
bump:
24+
cz bump
25+
2326
commit:
2427
cz commit
2528

26-
.PHONY: checkformat format lint ruff mypy pytest commit
29+
.PHONY: checkformat format lint ruff mypy pytest bump commit

pyproject.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ authors = [{ name = "Tobias Jülg", email = "tobias.juelg@utn.de" }]
2424
requires-python = ">=3.10"
2525
license = "Apache-2.0"
2626

27+
classifiers = [
28+
"Programming Language :: Python :: 3",
29+
]
30+
31+
[project.urls]
32+
Homepage = "https://github.com/RobotControlStack/vlagents"
33+
Issues = "https://github.com/RobotControlStack/vlagents/issues"
34+
2735

2836
[project.optional-dependencies]
2937
dev = [
@@ -105,3 +113,12 @@ pretty = true
105113
minversion = "6.0"
106114
addopts = "-vv"
107115
testpaths = ["tests"]
116+
117+
118+
[tool.commitizen]
119+
name = "cz_conventional_commits"
120+
tag_format = "v$version"
121+
version_scheme = "pep440"
122+
version_provider = "pep621"
123+
update_changelog_on_bump = true
124+
major_version_zero = true

0 commit comments

Comments
 (0)