Skip to content

Commit b6e723c

Browse files
chore: bump version to 1.0.0-rc.2
1 parent 1a8675b commit b6e723c

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
name: Create GitHub Release
22

33
on:
4+
workflow_run:
5+
workflows: ["Build and Push Docker Image"]
6+
types:
7+
- completed
8+
branches:
9+
- main
10+
- dev
411
push:
512
tags:
6-
- '*' # Trigger on any tag push
13+
- '*' # Also trigger on manual tag pushes
714

815

916
jobs:
1017
release:
1118
runs-on: ubuntu-latest
19+
# Only run if the triggering workflow succeeded
20+
if: ${{ github.event_name == 'push' || github.event.workflow_run.conclusion == 'success' }}
1221

1322
permissions:
1423
packages: write
@@ -20,6 +29,7 @@ jobs:
2029
with:
2130
fetch-depth: 0 # Fetch all history for all tags and branches
2231
fetch-tags: true # Fetch all tags
32+
ref: ${{ github.event.workflow_run.head_branch || github.ref }}
2333

2434
- name: Set up Python
2535
uses: actions/setup-python@v6
@@ -34,10 +44,26 @@ jobs:
3444
- name: Get current tag
3545
id: get-tag
3646
run: |
37-
# Get the tag that triggered this workflow
38-
TAG_NAME=${GITHUB_REF#refs/tags/}
39-
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT
40-
echo "Current tag: ${TAG_NAME}"
47+
# If triggered by workflow_run, read version from version.py
48+
if [ "${{ github.event_name }}" = "workflow_run" ]; then
49+
# Read version from version.py (same as CI workflow did)
50+
VERSION=$(grep -oP '__version__\s*=\s*"\K[^"]*' app/core/version.py || echo "")
51+
if [ -z "${VERSION}" ]; then
52+
# Fallback: try Python import
53+
VERSION=$(python -c "import sys; sys.path.insert(0, '.'); from app.core.version import __version__; print(__version__)" 2>/dev/null || echo "")
54+
fi
55+
if [ -z "${VERSION}" ]; then
56+
echo "Error: Could not read version from version.py"
57+
exit 1
58+
fi
59+
echo "TAG_NAME=${VERSION}" >> $GITHUB_OUTPUT
60+
echo "Tag from version.py: ${VERSION}"
61+
else
62+
# If triggered by tag push, get from GITHUB_REF
63+
TAG_NAME=${GITHUB_REF#refs/tags/}
64+
echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_OUTPUT
65+
echo "Current tag from push: ${TAG_NAME}"
66+
fi
4167
4268
- name: Checkout tag commit
4369
run: |

app/core/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.0-rc.1"
1+
__version__ = "1.0.0-rc.2"

0 commit comments

Comments
 (0)