Skip to content

Commit 1712f61

Browse files
committed
fix: merge publish job files
1 parent e3a0dce commit 1712f61

File tree

2 files changed

+21
-45
lines changed

2 files changed

+21
-45
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ on:
44
push:
55
tags:
66
- "v[0-9]+.[0-9]+.[0-9]+"
7+
workflow_dispatch:
8+
inputs:
9+
branch:
10+
description: Branch that contains the release
11+
required: true
12+
type: string
713

814
jobs:
915
publish:
@@ -13,6 +19,12 @@ jobs:
1319
id-token: write
1420
steps:
1521
- uses: actions/checkout@v3
22+
if: github.event_name == 'push'
23+
24+
- uses: actions/checkout@v3
25+
if: github.event_name == 'workflow_dispatch'
26+
with:
27+
ref: ${{ inputs.branch }}
1628

1729
- name: Install Poetry
1830
run: pipx install poetry==1.8.3
@@ -23,13 +35,22 @@ jobs:
2335
poetry install --all-extras
2436
2537
- name: Check package version matches tag
38+
if: github.event_name == 'push'
2639
run: |
2740
TAG_VERSION=${GITHUB_REF#refs/tags/v}
2841
PACKAGE_VERSION=$(poetry version -s)
2942
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
3043
echo "Error: Tag version ($TAG_VERSION) does not match package version ($PACKAGE_VERSION)"
3144
exit 1
3245
fi
46+
- name: Check that version is alpha version
47+
if: github.event_name == 'workflow_dispatch'
48+
run: |
49+
PACKAGE_VERSION=$(poetry version -s)
50+
if [[ ! "$PACKAGE_VERSION" =~ .*a[0-9]+$ ]]; then
51+
echo "Error: Package version ($PACKAGE_VERSION) is not an alpha version (should end with 'aN' where N is a number)"
52+
exit 1
53+
fi
3354
3455
- name: Build Python package
3556
run: poetry build

.github/workflows/publish_alpha.yml

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

0 commit comments

Comments
 (0)