Skip to content

Commit 8620312

Browse files
committed
Merge branch 'master' into implement-offers-v2
2 parents efe2161 + fcd1c21 commit 8620312

File tree

6 files changed

+86
-3552
lines changed

6 files changed

+86
-3552
lines changed

.github/workflows/publish.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 73 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,79 @@
1-
name: Create Release
1+
name: Create Release and Publish
22

33
on:
4-
workflow_dispatch:
4+
workflow_dispatch:
55

66
permissions:
7-
contents: write
7+
contents: write
8+
id-token: write
89

910
jobs:
10-
release:
11-
runs-on: ubuntu-latest
12-
if: github.ref == 'refs/heads/master'
13-
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v5
17-
18-
- name: Extract version and notes from CHANGELOG
19-
id: changelog
20-
run: |
21-
# Extract version from first ## [x.x.x] header
22-
VERSION=$(grep -m1 -oP '## \[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md)
23-
echo "version=$VERSION" >> $GITHUB_OUTPUT
24-
25-
# Extract release notes (content between first and second ## headers)
26-
NOTES=$(awk '/^## \['"$VERSION"'\]/{flag=1; next} /^## \[/{flag=0} flag' CHANGELOG.md)
27-
28-
# Handle multiline output
29-
{
30-
echo "notes<<EOF"
31-
echo "$NOTES"
32-
echo "EOF"
33-
} >> $GITHUB_OUTPUT
34-
35-
- name: Check if tag already exists
36-
id: check_tag
37-
run: |
38-
if git rev-parse "v${{ steps.changelog.outputs.version }}" >/dev/null 2>&1; then
39-
echo "exists=true" >> $GITHUB_OUTPUT
40-
else
41-
echo "exists=false" >> $GITHUB_OUTPUT
42-
fi
43-
44-
- name: Create Release
45-
if: steps.check_tag.outputs.exists == 'false'
46-
uses: softprops/action-gh-release@v2
47-
with:
48-
tag_name: ${{ steps.changelog.outputs.version }}
49-
name: v${{ steps.changelog.outputs.version }}
50-
body: ${{ steps.changelog.outputs.notes }}
51-
draft: false
52-
prerelease: false
53-
54-
- name: Skip release (tag exists)
55-
if: steps.check_tag.outputs.exists == 'true'
56-
run: |
57-
echo "⚠️ Tag v${{ steps.changelog.outputs.version }} already exists. Skipping release creation."
58-
exit 1
11+
release:
12+
runs-on: ubuntu-latest
13+
if: github.ref == 'refs/heads/master'
14+
environment: pypi
15+
outputs:
16+
version: ${{ steps.changelog.outputs.version }}
17+
released: ${{ steps.check_tag.outputs.exists == 'false' }}
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v5
22+
23+
- name: Extract version and notes from CHANGELOG
24+
id: changelog
25+
run: |
26+
# Extract version from first ## [x.x.x] header
27+
VERSION=$(grep -m1 -oP '## \[\K[0-9]+\.[0-9]+\.[0-9]+' CHANGELOG.md)
28+
echo "version=$VERSION" >> $GITHUB_OUTPUT
29+
30+
# Extract release notes (content between first and second ## headers)
31+
NOTES=$(awk '/^## \['"$VERSION"'\]/{flag=1; next} /^## \[/{flag=0} flag' CHANGELOG.md)
32+
33+
# Handle multiline output
34+
{
35+
echo "notes<<EOF"
36+
echo "$NOTES"
37+
echo "EOF"
38+
} >> $GITHUB_OUTPUT
39+
40+
- name: Check if tag already exists
41+
id: check_tag
42+
run: |
43+
if git rev-parse "v${{ steps.changelog.outputs.version }}" >/dev/null 2>&1; then
44+
echo "exists=true" >> $GITHUB_OUTPUT
45+
else
46+
echo "exists=false" >> $GITHUB_OUTPUT
47+
fi
48+
49+
- name: Create Release
50+
if: steps.check_tag.outputs.exists == 'false'
51+
uses: softprops/action-gh-release@v2
52+
with:
53+
tag_name: ${{ steps.changelog.outputs.version }}
54+
name: v${{ steps.changelog.outputs.version }}
55+
body: ${{ steps.changelog.outputs.notes }}
56+
draft: false
57+
prerelease: false
58+
59+
- name: Skip release (tag exists)
60+
if: steps.check_tag.outputs.exists == 'true'
61+
run: |
62+
echo "⚠️ Tag v${{ steps.changelog.outputs.version }} already exists. Skipping release creation."
63+
exit 1
64+
65+
- name: Set up Python
66+
uses: actions/setup-python@v5
67+
with:
68+
python-version: "3.x"
69+
70+
- name: Install dependencies
71+
run: |
72+
python -m pip install --upgrade pip
73+
pip install build
74+
75+
- name: Build package
76+
run: python -m build
77+
78+
- name: Publish to PyPI
79+
uses: pypa/gh-action-pypi-publish@release/v1

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
- Improved docstrings across the codebase
3131
- Completely rewritten README with clearer structure and examples
3232
- Updated Read the Docs configuration to v2 format with modern Sphinx versions
33+
- Updated documentation to furo theme
3334

3435
### Removed
3536

0 commit comments

Comments
 (0)