Skip to content

Commit ef25fb6

Browse files
WIP Add package and release workflow
1 parent 602eec2 commit ef25fb6

3 files changed

Lines changed: 66 additions & 2 deletions

File tree

.github/workflows/package.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Package
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
6+
# Cancel any ongoing run of this workflow on the same PR or ref
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout sources
16+
uses: actions/checkout@v4
17+
- name: Setup uv
18+
uses: astral-sh/setup-uv@v6
19+
with:
20+
python-version: '3.14'
21+
enable-cache: true
22+
- name: Build Package
23+
run: |
24+
uv build --sdist
25+
- name: Upload package artifact
26+
uses: actions/upload-artifact@v6
27+
with:
28+
name: pip-package
29+
path: dist/
30+
publish-pypi:
31+
if: github.ref_type == 'tag'
32+
needs: [build]
33+
runs-on: ubuntu-latest
34+
environment:
35+
name: pypi
36+
url: https://pypi.org/p/khalib
37+
permissions:
38+
id-token: write
39+
steps:
40+
- name: Download package artifact
41+
uses: actions/download-artifact@v6
42+
with:
43+
name: pip-package
44+
path: dist/
45+
- name: Publish to PyPI
46+
uses: pypa/gh-action-pypi-publish@release/v1
47+
publish-testpypi:
48+
needs: [build]
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: testpypi
52+
url: https://test.pypi.org/p/khalib
53+
permissions:
54+
id-token: write
55+
steps:
56+
- name: Download package artifact
57+
uses: actions/download-artifact@v6
58+
with:
59+
name: pip-package
60+
path: dist/
61+
- name: Publish to TestPyPI
62+
uses: pypa/gh-action-pypi-publish@release/v1
63+
with:
64+
repository-url: https://test.pypi.org/build/

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "khalib"
7-
version = "0.1"
7+
version = "0.2rc1"
88
description = "Classifier Calibration with Khiops"
99
authors = [{ name = "Felipe Olmos", email = "luisfelipe.olmosmarchant@orange.com" }]
1010
requires-python = ">=3.11"

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)