-
Notifications
You must be signed in to change notification settings - Fork 3
45 lines (45 loc) · 1.34 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Publish to PyPI
on:
workflow_dispatch:
inputs:
PYTHON_VERSION:
description: "Python Version"
required: false
default: "3.12.2"
POETRY_VERSION:
description: "The version of Poetry to use"
required: false
default: "1.8.2"
RELEASE_TAG:
description: "The new version should be a valid PEP 440 string"
required: true
default: "0.3.0"
defaults:
run:
working-directory: ./tools
jobs:
pypi_release:
name: Builds Using Poetry and Publishes to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Poetry
run: pip install poetry==${{ inputs.POETRY_VERSION }}
shell: bash
- name: Set up Python ${{ inputs.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.PYTHON_VERSION }}
- run: poetry version ${{ inputs.RELEASE_TAG }}
- run: poetry install
- run: poetry config pypi-token.pypi "${{ secrets.PYPI_TOKEN }}"
- name: Publish package
run: poetry publish --build
- name: Build binary
run: poetry run build
- uses: ncipollo/release-action@v1
with:
artifacts: "tools/dist/cgdevxcli"
generateReleaseNotes: true
commit: main
tag: ${{ inputs.RELEASE_TAG }}