Skip to content

Commit 477ff3b

Browse files
committed
cicd: Updated deployment to trusted publisher workflow
1 parent 0e2e8ed commit 477ff3b

4 files changed

Lines changed: 79 additions & 101 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: Publish Python 🐍 distribution 📦 to PyPI
2+
on: push
3+
4+
jobs:
5+
build:
6+
name: Build distribution 📦
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
persist-credentials: false
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.x"
17+
- name: Install pypa/build
18+
run: >-
19+
python3 -m
20+
pip install
21+
build
22+
--user
23+
- name: Build a binary wheel and a source tarball
24+
run: python3 -m build
25+
- name: Store the distribution packages
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: python-package-distributions
29+
path: dist/
30+
31+
publish-to-pypi:
32+
name: >-
33+
Publish Python 🐍 distribution 📦 to PyPI
34+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
35+
needs:
36+
- build
37+
runs-on: ubuntu-latest
38+
environment:
39+
name: pypi
40+
url: https://pypi.org/p/viur-core
41+
permissions:
42+
id-token: write # IMPORTANT: mandatory for trusted publishing
43+
44+
steps:
45+
- name: Download all the dists
46+
uses: actions/download-artifact@v4
47+
with:
48+
name: python-package-distributions
49+
path: dist/
50+
- name: Publish distribution 📦 to PyPI
51+
uses: pypa/gh-action-pypi-publish@release/v1
52+
53+
# publish-to-testpypi:
54+
# name: Publish Python 🐍 distribution 📦 to TestPyPI
55+
# needs:
56+
# - build
57+
# runs-on: ubuntu-latest
58+
#
59+
# environment:
60+
# name: testpypi
61+
# url: https://test.pypi.org/p/viur-core
62+
#
63+
# permissions:
64+
# id-token: write # IMPORTANT: mandatory for trusted publishing
65+
#
66+
# steps:
67+
# - name: Download all the dists
68+
# uses: actions/download-artifact@v4
69+
# with:
70+
# name: python-package-distributions
71+
# path: dist/
72+
# - name: Publish distribution 📦 to TestPyPI
73+
# uses: pypa/gh-action-pypi-publish@release/v1
74+
# with:
75+
# repository-url: https://test.pypi.org/legacy/
76+
#

.github/workflows/publish.yml

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

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.idea/*
2-
dist/
3-
build/
4-
*/*.egg-info
5-
**/__pycache__
6-
vue/node_modules
1+
.idea
2+
.vscode
73
*.pyc

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This file documents any relevant changes.
44

55
## [2.3.0] 2025-10-20
66

7+
- cicd: Updated deployment to trusted publisher workflow
78
- refactor: Integrate new `viur-scriptor-api` v1 (#197)
89

910
## [2.2.1] 2025-05-22

0 commit comments

Comments
 (0)