Skip to content

Commit aaa0ec8

Browse files
committed
add workflow
1 parent c820e11 commit aaa0ec8

File tree

3 files changed

+80
-8
lines changed

3 files changed

+80
-8
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
env:
4343
HATCH_BUILD_HOOK_VCS_VERSION: ${{ steps.gitversion.outputs.semVer }}
4444

45-
- name: Publish
46-
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
47-
run: |
48-
uv publish
49-
env:
50-
UV_PUBLISH_TOKEN: ${{ secrets.token }}
45+
# - name: Publish
46+
# if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')
47+
# run: |
48+
# uv publish
49+
# env:
50+
# UV_PUBLISH_TOKEN: ${{ secrets.token }}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Promote Alpha to Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to promote (without alpha suffix, e.g., 0.0.98)'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
promote:
13+
name: Promote alpha to release
14+
runs-on: "ubuntu-24.04"
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Set Git User
23+
run: |
24+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
25+
git config --local user.name "github-actions[bot]"
26+
27+
- name: Create and Push Tag
28+
run: |
29+
VERSION="${{ github.event.inputs.version }}"
30+
echo "Creating release tag v$VERSION"
31+
git tag -a "v$VERSION" -m "Release v$VERSION"
32+
git push origin "v$VERSION"
33+
34+
- name: Install GitVersion
35+
uses: gittools/actions/gitversion/[email protected]
36+
with:
37+
versionSpec: '5.x'
38+
39+
- name: Determine Version
40+
id: gitversion
41+
uses: gittools/actions/gitversion/[email protected]
42+
with:
43+
useConfigFile: true
44+
45+
- uses: astral-sh/setup-uv@v5
46+
47+
- uses: actions/setup-python@v5
48+
with:
49+
python-version-file: ".python-version"
50+
51+
- name: Setup venv
52+
run: |
53+
uv venv
54+
uv sync --all-extras
55+
56+
- name: Build
57+
run: |
58+
uv build
59+
env:
60+
HATCH_BUILD_HOOK_VCS_VERSION: ${{ github.event.inputs.version }}
61+
62+
# - name: Publish
63+
# run: |
64+
# uv publish
65+
# env:
66+
# UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}

GitVersion.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mode: Mainline
2-
next-version: 0.0.99
2+
next-version: 0.0.98
33
major-version-bump-message: '\+semver:\s?(breaking|major)'
44
minor-version-bump-message: '\+semver:\s?(feature|minor)'
55
patch-version-bump-message: '\+semver:\s?(fix|patch)'
@@ -9,7 +9,7 @@ commit-message-incrementing: Enabled
99
branches:
1010
main:
1111
regex: ^main$|^master$
12-
tag: ''
12+
tag: 'alpha'
1313
increment: Patch
1414
feature:
1515
regex: ^feature?\/
@@ -23,6 +23,12 @@ branches:
2323
regex: ^release?\/
2424
tag: 'rc'
2525
increment: None
26+
release-tag:
27+
regex: ^v[0-9]+\.[0-9]+\.[0-9]+$
28+
tag: ''
29+
source-branches: ['main']
30+
is-release-branch: true
31+
increment: None
2632
ignore:
2733
sha: []
2834
merge-message-formats: {}

0 commit comments

Comments
 (0)