Skip to content

Commit 32f1ea7

Browse files
authored
ci: add manual release candidate workflow
1 parent 7cdc5f6 commit 32f1ea7

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#
2+
# Copyright 2022-Present Sonatype Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
name: Manual Pre Release Publish
17+
18+
on:
19+
workflow_dispatch:
20+
inputs:
21+
release_candidate_suffix:
22+
description: 'RC Suffix e.g. rc0, beta1, alpha2. Do not include a leading hyphen.'
23+
required: true
24+
type: string
25+
26+
jobs:
27+
release_candidate:
28+
runs-on: ubuntu-latest
29+
concurrency: release_candidate
30+
steps:
31+
- name: Checkout code
32+
uses: actions/checkout@v2
33+
with:
34+
fetch-depth: 0
35+
- uses: actions/setup-python@v2
36+
with:
37+
python-version: 3.9
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install poetry --upgrade pip
41+
poetry config virtualenvs.create false
42+
poetry install
43+
python -m pip install python-semantic-release
44+
- name: Apply Pre Release Version
45+
run: |
46+
RC_VERSION="$(semantic-release --noop --major print-version)-${{ github.event.inputs.release_candidate_suffix }}"
47+
echo "RC Version will be: ${RC_VERSION}"
48+
poetry version ${RC_VERSION}
49+
poetry build
50+
- name: Publish Pre Release 📦 to PyPI
51+
uses: pypa/gh-action-pypi-publish@master
52+
with:
53+
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)