Skip to content

Commit e5b7a96

Browse files
committed
Add tagged release workflow
1 parent 4a32e70 commit e5b7a96

1 file changed

Lines changed: 75 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
id-token: write
11+
12+
jobs:
13+
build:
14+
name: Build distribution
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.x"
25+
26+
- name: Install build tooling
27+
run: python -m pip install --upgrade build
28+
29+
- name: Build package
30+
run: python -m build
31+
32+
- name: Upload distribution artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: python-package-distributions
36+
path: dist/*
37+
38+
publish-pypi:
39+
name: Publish to PyPI
40+
needs: build
41+
runs-on: ubuntu-latest
42+
environment:
43+
name: pypi
44+
url: https://pypi.org/p/tempolocus
45+
permissions:
46+
id-token: write
47+
48+
steps:
49+
- name: Download distribution artifacts
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: python-package-distributions
53+
path: dist/
54+
55+
- name: Publish package distributions to PyPI
56+
uses: pypa/gh-action-pypi-publish@release/v1
57+
58+
github-release:
59+
name: Create GitHub release
60+
needs: publish-pypi
61+
runs-on: ubuntu-latest
62+
permissions:
63+
contents: write
64+
65+
steps:
66+
- name: Download distribution artifacts
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: python-package-distributions
70+
path: dist/
71+
72+
- name: Create GitHub release
73+
uses: softprops/action-gh-release@v2
74+
with:
75+
files: dist/*

0 commit comments

Comments
 (0)