Skip to content

Commit 41dab7e

Browse files
Antony BaileyAntony Bailey
authored andcommitted
ver update
1 parent bd1b5a0 commit 41dab7e

File tree

2 files changed

+50
-43
lines changed

2 files changed

+50
-43
lines changed

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
if [ -f "setup.py" ]; then
3636
sed -i "s/version=['\"][^'\"]*['\"]/version='${VERSION}'/g" setup.py
3737
fi
38-
if [ -f "pyproject.toml" ]; then
38+
if [ -f "pyproject.toml" x]; then
3939
sed -i "s/version = \"[^\"]*\"/version = \"${VERSION}\"/g" pyproject.toml
4040
fi
4141
if [ -f "__init__.py" ]; then

.github/workflows/release-tags.yml

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,56 @@
11
name: Release on Tags
22

33
on:
4-
push:
5-
tags:
6-
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
4+
push:
5+
tags:
6+
- '*' # Push events to matching v*, i.e. v1.0, v20.15.10
77

88
permissions:
9-
contents: write
10-
packages: write
9+
contents: write
10+
packages: write
1111

1212
jobs:
13-
build-and-release:
14-
runs-on: ubuntu-latest
15-
steps:
16-
- name: Checkout code
17-
uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
21-
- name: Set up Python
22-
uses: actions/setup-python@v5
23-
with:
24-
python-version: 3.x
25-
26-
- name: Install dependencies
27-
run: |
28-
python -m pip install --upgrade pip
29-
pip install setuptools wheel twine
30-
31-
- name: Extract tag name
32-
id: tag
33-
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
34-
35-
- name: Build and package
36-
run: |
37-
python setup.py sdist bdist_wheel
38-
39-
- name: Create Release
40-
id: create_release
41-
uses: softprops/action-gh-release@v2
42-
with:
43-
name: Release ${{ steps.tag.outputs.TAG_NAME }}
44-
draft: false
45-
prerelease: false
46-
files: |
47-
dist/*
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.TAG_TOKEN }}
13+
build-and-release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: 3.x
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install setuptools wheel twine
30+
31+
- name: Extract tag name
32+
id: tag
33+
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
34+
35+
- name: Update version in setup.py
36+
run: |
37+
# Remove 'v' prefix if present
38+
VERSION="${{ steps.tag.outputs.TAG_NAME }}"
39+
VERSION=${VERSION#v}
40+
sed -i "s/version=['\"][^'\"]*['\"]/version='$VERSION'/g" setup.py
41+
42+
- name: Build and package
43+
run: |
44+
python setup.py sdist bdist_wheel
45+
46+
- name: Create Release
47+
id: create_release
48+
uses: softprops/action-gh-release@v2
49+
with:
50+
name: Release ${{ steps.tag.outputs.TAG_NAME }}
51+
draft: false
52+
prerelease: false
53+
files: |
54+
dist/*
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.TAG_TOKEN }}

0 commit comments

Comments
 (0)