Skip to content

Commit 20f6c10

Browse files
Antony BaileyAntony Bailey
authored andcommitted
ver update
1 parent fb85fff commit 20f6c10

File tree

2 files changed

+53
-45
lines changed

2 files changed

+53
-45
lines changed

.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 }}

.github/workflows/sha-pins.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ jobs:
99
check-and-update-workflows:
1010
runs-on: ubuntu-latest
1111
permissions:
12-
contents: write
12+
contents: read
1313
pull-requests: write
14+
actions: write
1415

1516
steps:
16-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
1718

1819
- name: Set up Python
19-
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
20+
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
2021
with:
2122
python-version: '3.11'
2223

0 commit comments

Comments
 (0)