Skip to content

Commit 0a06e02

Browse files
committed
Update version automatically based on tag name
1 parent 0046e94 commit 0a06e02

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
# This workflow will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: Upload Python Package
52

63
on:
74
release:
85
types: [created]
96

107
jobs:
11-
deploy:
128

9+
deploy:
1310
runs-on: ubuntu-latest
14-
1511
steps:
16-
- uses: actions/checkout@v2
12+
- name: Check out code
13+
uses: actions/checkout@v3
1714
- name: Set up Python
18-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v4
1916
with:
2017
python-version: '3.x'
2118
- name: Install dependencies
2219
run: |
2320
python -m pip install --upgrade pip
2421
pip install setuptools wheel twine
22+
- name: Update version number
23+
run: |
24+
sed -i 's/<PACKAGE_VERSION>/${{ github.ref_name }}/' setup.py
2525
- name: Build and publish
2626
env:
2727
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="python-amazon-paapi",
8-
version="4.3.2",
8+
version="<PACKAGE_VERSION>",
99
author="Sergio Abad",
1010
author_email="sergio.abad@bytelix.com",
1111
description="Amazon Product Advertising API 5.0 wrapper for Python",

0 commit comments

Comments
 (0)