forked from antonioromeu/pyModRev
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.16 KB
/
Copy pathpython-publish.yml
File metadata and controls
45 lines (36 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Publish Python Package
on:
push:
tags:
- 'v*' # Trigger workflow on tags that start with "v" (e.g., v1.0.0)
jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
# Required for trusted publishing to PyPI
permissions:
id-token: write
contents: write # Elevated from 'read' to allow Release creation
steps:
- name: Checkout Code
uses: actions/checkout@v6
with:
fetch-depth: 0 # Important for setuptools_scm to get the full git history and tags
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install build dependencies
run: python -m pip install --upgrade pip build
- name: Build sdist and wheel
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
# This will include the .tar.gz and .whl files in the GitHub Release assets
files: dist/*
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}