-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.6 KB
/
publish.yaml
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
46
47
48
49
50
51
52
53
54
55
name: 'Publish Release'
on:
push:
tags:
- '*'
env:
# TODO: Update the package name to match the name of your package.
PACKAGE_NAME: python_template_x
jobs:
publish:
name: Publish Release
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Setup Dependencies
uses: './.github/actions/deps'
with:
python-version: '3.13'
- name: Run Security Check
run: poetry run poe security
- name: Get Python Module Version
run: |
MODULE_VERSION=$(poetry version --short)
echo "MODULE_VERSION=$MODULE_VERSION" >> $GITHUB_ENV
- name: Verify Versions Match
run: |
TAG_VERSION=$(git describe HEAD --tags --abbrev=0)
echo "Git Tag Version: $TAG_VERSION"
echo "Python Module Version: $MODULE_VERSION"
if [[ "$TAG_VERSION" != "$MODULE_VERSION" ]]; then exit 1; fi
# TODO: Update the PyPi token to push to PyPi.
- name: Publish to PyPi
run: poetry publish --build
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.POETRY_PYPI_TOKEN_PYPI }}
- name: Release
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
with:
discussion_category_name: announcements
generate_release_notes: true
files: |
dist/${{env.PACKAGE_NAME}}-${{env.MODULE_VERSION}}.tar.gz
dist/${{env.PACKAGE_NAME}}-${{env.MODULE_VERSION}}-py3-none-any.whl