Skip to content

Commit 8a39222

Browse files
committed
updated ci for pip release
1 parent e4a8f5e commit 8a39222

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches:
77
- master
88
- devel
9+
tags:
10+
- "[0-9]+.[0-9]+.[0-9]+"
911

1012
jobs:
1113

@@ -66,3 +68,37 @@ jobs:
6668
branch: gh-pages
6769
directory: __gh-pages/
6870
github_token: ${{ secrets.GITHUB_TOKEN }}
71+
72+
release:
73+
name: Build & Publish Release
74+
runs-on: ubuntu-latest
75+
if: startsWith(github.ref, 'refs/tags/')
76+
steps:
77+
- uses: actions/checkout@v4
78+
- name: Set up Python
79+
uses: actions/setup-python@v5
80+
with:
81+
python-version: "3.11"
82+
- name: Install build dependencies
83+
run: |
84+
python -m pip install --upgrade pip build twine
85+
- name: Build package
86+
run: python -m build
87+
- name: Publish to PyPI
88+
uses: pypa/gh-action-pypi-publish@release/v1
89+
with:
90+
user: __token__
91+
password: ${{ secrets.PYPI_API_TOKEN }}
92+
- name: Create GitHub Release
93+
id: create_release
94+
uses: actions/create-release@v1
95+
with:
96+
tag_name: ${{ github.ref_name }}
97+
release_name: Release ${{ github.ref_name }}
98+
body: |
99+
Changes in this release:
100+
- see commit history for details
101+
draft: false
102+
prerelease: false
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)