Skip to content

Commit 58f8363

Browse files
authored
streamline pipeline into two parts for developing and publishing (#126)
* streamline pipeline into two parts for developing and publishing * update changelog and bump patch version * add ruff and change all titles to lower case
1 parent c6cc18b commit 58f8363

File tree

10 files changed

+129
-174
lines changed

10 files changed

+129
-174
lines changed

.github/workflows/cd-pipeline.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: CD Pipeline
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
test_publish_package:
8+
name: publish package to test pypi
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write # IMPORTANT: mandatory for trusted publishing
12+
steps:
13+
- name: checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: set up python
17+
uses: actions/setup-python@v3
18+
with:
19+
python-version: 3.11
20+
21+
- name: install uv
22+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
23+
24+
- name: build package
25+
run: uv build
26+
27+
- name: publish package
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
user: __token__
31+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
32+
repository-url: https://test.pypi.org/legacy/
33+
34+
publish:
35+
name: publish package to pypi
36+
runs-on: ubuntu-latest
37+
permissions:
38+
id-token: write # IMPORTANT: mandatory for trusted publishing
39+
steps:
40+
- name: checkout code
41+
uses: actions/checkout@v4
42+
43+
- name: set up python
44+
uses: actions/setup-python@v3
45+
with:
46+
python-version: 3.11
47+
48+
- name: install uv
49+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
50+
51+
# - name: Add uv to PATH
52+
# run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
53+
54+
- name: build
55+
run: uv build
56+
57+
- name: publish
58+
uses: pypa/gh-action-pypi-publish@release/v1
59+
with:
60+
user: __token__
61+
password: ${{ secrets.PYPI_API_TOKEN }}
62+
63+
publish_docs:
64+
name: trigger docs pipeline
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: trigger downstream workflow
68+
uses: peter-evans/repository-dispatch@v3
69+
with:
70+
token: ${{ secrets.GITHUB_TOKEN }}
71+
repository: hololinked-dev/docs
72+
event-type: trigger-downstream
Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Unit Tests For Development
1+
name: CI Pipeline
22

33
on:
44
workflow_dispatch:
@@ -10,6 +10,26 @@ on:
1010
- main
1111

1212
jobs:
13+
codestyle:
14+
name: ruff codestyle check/linting
15+
runs-on: ubuntu-latest
16+
continue-on-error: true
17+
18+
steps:
19+
- name: checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: set up python 3.11
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: 3.11
26+
27+
- name: install ruff
28+
run: pip install ruff
29+
30+
- name: run ruff linter
31+
run: ruff check hololinked
32+
1333
test:
1434
strategy:
1535
matrix:
@@ -32,57 +52,57 @@ jobs:
3252
runs-on: ${{ matrix.os }}
3353

3454
steps:
35-
- name: Checkout code
55+
- name: checkout code
3656
uses: actions/checkout@v4
3757

38-
- name: Set up Python ${{ matrix.python-version }}
58+
- name: set up python ${{ matrix.python-version }}
3959
uses: actions/setup-python@v3
4060
with:
4161
python-version: ${{ matrix.python-version }}
4262

43-
- name: Install uv (Linux/macOS)
63+
- name: install uv (linux/macOS)
4464
if: runner.os != 'Windows'
4565
run: curl -LsSf https://astral.sh/uv/install.sh | sh
4666

47-
- name: Install uv (Windows)
67+
- name: install uv (windows)
4868
if: runner.os == 'Windows'
4969
run: |
5070
python -m pip install uv
5171
52-
- name: Install dependencies (Linux/macOS)
72+
- name: install dependencies (linux/macOS)
5373
if: runner.os != 'Windows'
5474
run: |
5575
uv venv .venv
5676
source .venv/bin/activate
5777
uv sync --no-install-project --group test --group dev
5878
59-
- name: Install dependencies (Windows)
79+
- name: install dependencies (windows)
6080
if: runner.os == 'Windows'
6181
run: |
6282
uv venv .venv
6383
.venv\Scripts\activate
6484
uv sync --no-install-project --group test --group dev
6585
66-
- name: Run unit tests (Linux/macOS)
86+
- name: run unit tests (linux/macOS)
6787
if: runner.os != 'Windows' && matrix.python-version != 3.13
6888
run: |
6989
source .venv/bin/activate
7090
uv run coverage run -m unittest discover -s tests -p 'test_*.py'
7191
72-
- name: Run unit tests and generate coverage report (Linux/macOS python 3.13)
92+
- name: run unit tests (Windows)
93+
if: runner.os == 'Windows'
94+
run: |
95+
.venv\Scripts\activate
96+
uv run coverage run -m unittest discover -s tests -p "test_*.py"
97+
98+
- name: run unit tests and generate coverage report (linux/macOS python 3.13)
7399
if: runner.os != 'Windows' && matrix.python-version == 3.13
74100
run: |
75101
source .venv/bin/activate
76102
uv run coverage run -m unittest discover -s tests -p 'test_*.py'
77103
uv run coverage xml -o coverage.xml
78104
79-
- name: Run unit tests (Windows)
80-
if: runner.os == 'Windows'
81-
run: |
82-
.venv\Scripts\activate
83-
uv run coverage run -m unittest discover -s tests -p "test_*.py"
84-
85-
- name: Upload coverage report as artifact
105+
- name: upload coverage report as artifact
86106
uses: actions/upload-artifact@v4
87107
if: runner.os != 'Windows' && matrix.python-version == 3.13
88108
with:
@@ -91,23 +111,23 @@ jobs:
91111
if-no-files-found: warn
92112

93113
publish_coverage:
94-
name: Publish coverage (Ubuntu Python 3.13)
114+
name: publish coverage
95115
needs: test
96116
runs-on: ubuntu-latest
97117
if: github.ref == 'refs/heads/main'
98118
steps:
99-
- name: Checkout code
119+
- name: checkout code
100120
uses: actions/checkout@v4
101121

102-
- name: Download Ubuntu 3.13 coverage artifact
122+
- name: download coverage artifact
103123
id: dl
104124
uses: actions/download-artifact@v4
105125
with:
106126
name: coverage-report-ubuntu-latest-py3.13
107127
path: .
108128
continue-on-error: true
109129

110-
- name: Upload coverage to Codecov
130+
- name: upload coverage to codecov
111131
if: steps.dl.outcome == 'success'
112132
uses: codecov/codecov-action@v4
113133
env:
@@ -118,30 +138,6 @@ jobs:
118138
fail_ci_if_error: true
119139
slug: hololinked-dev/hololinked
120140

121-
- name: Skip note (no Ubuntu 3.13 artifact found)
141+
- name: skip note (no artifact found)
122142
if: steps.dl.outcome != 'success'
123-
run: echo "No Ubuntu 3.13 coverage artifact present; skipping Codecov upload."
124-
125-
publish_package:
126-
name: Publish package to Test PyPI
127-
runs-on: ubuntu-latest
128-
needs: test
129-
if: github.event_name == 'workflow_dispatch'
130-
permissions:
131-
id-token: write # IMPORTANT: mandatory for trusted publishing
132-
steps:
133-
- uses: actions/checkout@v4
134-
- name: Set up Python
135-
uses: actions/setup-python@v3
136-
with:
137-
python-version: 3.11
138-
- name: Install uv
139-
run: curl -LsSf https://astral.sh/uv/install.sh | sh
140-
- name: Build package
141-
run: uv build
142-
- name: Publish package
143-
uses: pypa/gh-action-pypi-publish@release/v1
144-
with:
145-
user: __token__
146-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
147-
repository-url: https://test.pypi.org/legacy/
143+
run: echo "No coverage artifact present; skipping codecov upload."

.github/workflows/python-publish-pypi.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/python-publish-testpypi.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/test-release.yml

Lines changed: 0 additions & 49 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
80, 120
44
],
55
"editor.formatOnSave": true,
6-
"ruff.lineLength": 120
6+
"ruff.lineLength": 120,
7+
"[yaml]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode",
9+
"editor.formatOnSave": true,
10+
"prettier.tabWidth": 2
11+
}
712
}

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88

99
✓ means ready to try
1010

11+
## [v0.3.5] - 2025-10-18
12+
13+
- supports MongoDB as a database for property persistence (see infrastructure project in README to quick-setup)
14+
- adds HTTP handlers for reading/writing multiple properties at once (which used to be supported <0.2.11 but removed later until now by mistake)
15+
- refactors CI/CD pipelines - separate workflows for developing and publishing
16+
1117
## [v0.3.4] - 2025-10-02
1218

1319
- fixes a bug in content type in the forms of TD for HTTP protocol binding, when multiple serializers are used

doc

Submodule doc updated from afa0e64 to d4e965b

hololinked/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.3.4"
1+
__version__ = "0.3.5"

0 commit comments

Comments
 (0)