Skip to content

Commit bd7533e

Browse files
haakonvtamorken
andauthored
chore: add manual release workflow for pre-releases (#2384)
Co-authored-by: Anders Daljord Morken <[email protected]>
1 parent d1e7307 commit bd7533e

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Pre-release
2+
3+
on:
4+
push:
5+
branches:
6+
'pysdk-release-*'
7+
8+
jobs:
9+
test_full_build_and_release:
10+
runs-on: windows-latest
11+
environment: CD
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- uses: ./.github/actions/setup
16+
17+
# Note: if we are to pre-release something other than v8,
18+
# we need to also update the regex below:
19+
- name: Ensure version is a pre-release
20+
shell: pwsh
21+
run: |
22+
$version = poetry version --short
23+
Write-Host "Detected version: $version"
24+
if ($version -match "^8\.0\.0(?:a|b|rc)\d+$") {
25+
Write-Host "✅ Version format is valid for a pre-release."
26+
} else {
27+
Write-Host "❌ Error: Version '$version' is not a valid pre-release (patch version must start with 'a', 'b', or 'rc' followed by a number)."
28+
exit 1
29+
}
30+
31+
- name: Build package
32+
run: poetry build
33+
34+
- name: Release to PyPI
35+
env:
36+
TWINE_USERNAME: __token__
37+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
38+
run: twine upload --skip-existing --disable-progress-bar --verbose dist/*

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
env:
4444
TWINE_USERNAME: __token__
4545
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
46-
run: twine upload --skip-existing --verbose dist/*
46+
run: twine upload --skip-existing --disable-progress-bar --verbose dist/*
4747

4848
# TODO: Make this work again
4949
# - name: Push code snippets to service-contracts

0 commit comments

Comments
 (0)