Skip to content

Commit 04dd335

Browse files
chore: change release to workflow_dispatch
- Update release mechanism to manually triggered
1 parent 0824d66 commit 04dd335

File tree

2 files changed

+48
-30
lines changed

2 files changed

+48
-30
lines changed

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Release
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
pre-commit:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- uses: actions/setup-python@v5
12+
with:
13+
python-version: "3.10"
14+
15+
# Install and run pre-commit
16+
- run: |
17+
pip install pre-commit
18+
pre-commit install
19+
pre-commit run --all-files
20+
21+
release:
22+
needs: [pre-commit]
23+
runs-on: ubuntu-latest
24+
environment:
25+
name: pypi
26+
url: https://pypi.org/p/trame-slicer
27+
permissions:
28+
id-token: write # IMPORTANT: mandatory for trusted publishing
29+
contents: write # IMPORTANT: mandatory for making GitHub Releases
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Python Semantic Release
38+
id: release
39+
uses: python-semantic-release/python-semantic-release@master
40+
with:
41+
github_token: ${{ secrets.GITHUB_TOKEN }}
42+
changelog: true
43+
44+
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
45+
- name: Publish package distributions to PyPI
46+
if: steps.release.outputs.released == 'true'
47+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test_and_release.yml renamed to .github/workflows/test_and_merge.yml

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test and Release
1+
name: Test and Merge
22

33
on:
44
push:
@@ -78,32 +78,3 @@ jobs:
7878
run: |
7979
pip install .[dev]
8080
pytest -s ./tests
81-
82-
release:
83-
needs: [pre-commit]
84-
runs-on: ubuntu-latest
85-
if: github.event_name == 'push'
86-
environment:
87-
name: pypi
88-
url: https://pypi.org/p/trame-slicer
89-
permissions:
90-
id-token: write # IMPORTANT: mandatory for trusted publishing
91-
contents: write # IMPORTANT: mandatory for making GitHub Releases
92-
93-
steps:
94-
- name: Checkout
95-
uses: actions/checkout@v4
96-
with:
97-
fetch-depth: 0
98-
99-
- name: Python Semantic Release
100-
id: release
101-
uses: python-semantic-release/python-semantic-release@master
102-
with:
103-
github_token: ${{ secrets.GITHUB_TOKEN }}
104-
changelog: true
105-
106-
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
107-
- name: Publish package distributions to PyPI
108-
if: steps.release.outputs.released == 'true'
109-
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)