Skip to content

Commit 532b2ed

Browse files
add workflow to publish stitching headless via trusted publishing (#273)
Co-authored-by: Lukas Weber <l.alex.w@web.de>
1 parent b890591 commit 532b2ed

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This workflow combines the building by https://github.com/OpenStitching/stitching/blob/main/.github/workflows/python-publish.yml
2+
# with the new trusted publishing by https://github.com/marketplace/actions/pypi-publish
3+
name: Upload Python Package
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/p/stitching-headless
18+
permissions:
19+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
20+
steps:
21+
- uses: actions/checkout@v3
22+
- name: Set up Python
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
- name: Modify setup.cfg for headless version
31+
run: |
32+
sed -i 's/name = stitching/name = stitching-headless/' setup.cfg
33+
sed -i 's/opencv-python/opencv-python-headless/' setup.cfg
34+
- name: Build package
35+
run: python -m build
36+
- name: Publish package distributions to PyPI
37+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)