Skip to content

Commit fb4fc1a

Browse files
authored
Update release.yml
1 parent c423b6c commit fb4fc1a

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,47 @@
1-
name: Bump version
1+
# Workflow for creating a new release version and publishing to PyPI
2+
name: Bump version and publish
23

4+
# This workflow is manually triggered
35
on:
46
workflow_dispatch
57

68
jobs:
9+
# Create a new version tag based on semantic versioning
710
tag:
11+
# Need write permissions to create tags in the repository
812
permissions:
913
contents: write
1014

1115
runs-on: ubuntu-latest
1216

1317
steps:
18+
# Generate a new version tag based on commit history
1419
- name: Generate Tag
1520
uses: cvxgrp/.github/actions/[email protected]
1621
with:
1722
github_token: ${{ secrets.GITHUB_TOKEN }}
23+
24+
# Publish the package to PyPI
25+
publish:
26+
# This job runs after the tag job completes successfully
27+
needs: tag
28+
runs-on: ubuntu-latest
29+
# Use the release environment for PyPI credentials
30+
environment: release
31+
32+
permissions:
33+
# Read access to repository contents
34+
contents: read
35+
# This permission is required for trusted publishing to PyPI
36+
id-token: write
37+
38+
steps:
39+
# Download the built distribution package
40+
- uses: actions/download-artifact@v4
41+
with:
42+
name: dist
43+
path: dist
44+
45+
# Publish the package to PyPI using trusted publishing
46+
- name: Publish to PyPI
47+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)