Skip to content

Commit

Permalink
Add automatic versioning, build/release actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Vejnár committed Feb 17, 2020
1 parent ce5542c commit 76991ab
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 1 deletion.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: build
on:
push:
branches-ignore:
- release

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: avakar/derive-version@85d631f1a12b084b2592d1160b3c9154ceea7ea8
id: version
- run: sed -i 's/{version}/${{ steps.version.outputs.version }}+${{ github.sha }}/g' setup.py
- run: python3 -m pip install setuptools wheel
- run: python3 setup.py sdist bdist_wheel
- uses: actions/[email protected]
with:
name: pe_tools-${{ steps.version.outputs.version }}+${{ github.sha }}
path: dist
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release
on:
push:
branches:
- release

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: avakar/derive-version@85d631f1a12b084b2592d1160b3c9154ceea7ea8
id: version
- run: sed -i 's/{version}/${{ steps.version.outputs.version }}/g' setup.py
- run: python3 -m pip install setuptools wheel
- run: python3 -m pip install twine
- run: python3 setup.py sdist bdist_wheel
- uses: actions/[email protected]
with:
name: pe_tools-${{ steps.version.outputs.version }}
path: dist
- name: Upload to PyPI
run: |
python3 -m twine upload -u avakar -p "${{ secrets.pypi_password }}" dist/*
- uses: avakar/tag-and-release@8f4b627f03fe59381267d3925d39191e27f44236
with:
tag_name: v${{ steps.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.3
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
# coding: utf-8

from setuptools import setup
import os

top, _ = os.path.split(__file__)
with open(os.path.join(top, 'VERSION'), 'r') as fin:
version = fin.read().strip() + '+local'
version = '{version}'.format(version=version)

setup(
name='pe_tools',
version='0.2.8',
version=version,

url='https://github.com/avast/pe_tools',
maintainer='Martin Vejnár',
Expand Down

0 comments on commit 76991ab

Please sign in to comment.