Skip to content

Commit a9df3af

Browse files
authored
Merge pull request #238 from European-XFEL/auto-release
Create a workflow for automatically publishing new releases
2 parents 8658a02 + 5fe53c8 commit a9df3af

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

.github/workflows/tests.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Tests
33
on:
44
push:
55
branches: [master]
6+
tags: ["*"]
67
pull_request:
78

89
env:
@@ -42,3 +43,27 @@ jobs:
4243
- name: Test with pytest
4344
run: |
4445
python3 -m pytest -v
46+
47+
publish:
48+
runs-on: ubuntu-latest
49+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
50+
needs: tests
51+
permissions:
52+
id-token: write
53+
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
58+
- name: Set up Python 3.10
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: "3.10"
62+
63+
- name: Build packages
64+
run: |
65+
python3 -m pip install build
66+
python3 -m build
67+
68+
- name: Publish package distributions to PyPI
69+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)