Skip to content

Commit 231a6eb

Browse files
BrunoSilvaAndradeBrunoSilvaAndrade
authored andcommitted
feat(pipeline): Adding automatic versioning pipeline
1 parent 1b7a04b commit 231a6eb

3 files changed

Lines changed: 28 additions & 1 deletion

File tree

.github/workflows/python-publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
name: Upload Python Package
1010

1111
on:
12+
push:
13+
tags:
14+
- 'v*'
1215
release:
1316
types: [published]
1417

@@ -30,6 +33,8 @@ jobs:
3033
run: |
3134
python -m pip install --upgrade pip
3235
pip install build
36+
- name: Set Release Version
37+
run: RELEASE_VERSION=${GITHUB_REF#refs/*/v}
3338
- name: Build package
3439
run: python -m build -w -s
3540
- name: Publish package

.github/workflows/version.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Bump version
2+
on:
3+
push:
4+
branches:
5+
- master
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v2
11+
- name: Bump version and push tag
12+
id: tag_version
13+
uses: mathieudutour/github-tag-action@v6.0
14+
with:
15+
github_token: ${{ secrets.GITHUB_TOKEN }}
16+
- name: Create a GitHub release
17+
uses: ncipollo/release-action@v1
18+
with:
19+
tag: ${{ steps.tag_version.outputs.new_tag }}
20+
name: Release ${{ steps.tag_version.outputs.new_tag }}
21+
body: ${{ steps.tag_version.outputs.changelog }}

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import setuptools
2+
import os
23

34
with open('README.md', 'r') as fh:
45
long_description = fh.read()
56

67
setuptools.setup(
78
name='python-config-parser',
8-
version='2.2.1',
9+
version=os.environ['RELEASE_VERSION'],
910
author='Bruno Silva de Andrade',
1011
author_email='brunojf.andrade@gmail.com',
1112
description='Project created to given the possibility of create dynamics config files',

0 commit comments

Comments
 (0)