-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (47 loc) · 1.46 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Python Package
on:
pull_request:
branches:
- main
release:
types: [published]
jobs:
build-publish:
name: Build and publish package
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install uv
python -m uv pip install build
- name: Build the CLI
run: python -m build --sdist --wheel
- name: Upload build artifacts
uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a
with:
name: armonik_cli
path: dist/*
if-no-files-found: error
- name: Publish to PyPiTest
if: github.event_name != 'release' # Skip for actual releases
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.DEV_PYPI_CLI_TOKEN }}
print-hash: true
packages-dir: dist/
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPi
if: github.event_name == 'release' # Publish on releases
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_CLI_TOKEN }}
print-hash: true
packages-dir: dist/