Skip to content

Commit

Permalink
Add release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelosthege committed Dec 2, 2021
1 parent fa05105 commit de15ace
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: release-pipeline

on:
release:
types:
- created


jobs:
release-job:
runs-on: ubuntu-latest
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: Test with pytest
run: |
pytest --cov=./gittrail --cov-report term-missing gittrail/
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Check version number match
run: |
echo "GITHUB_REF: ${GITHUB_REF}"
# Make sure the package version is the same as the tag
grep -Rq "^Version: ${GITHUB_REF:11}$" gittrail.egg-info/PKG-INFO
- name: Publish to PyPI
run: |
twine check dist/*
twine upload --repository pypi --username __token__ --password ${PYPI_TOKEN} dist/*
- name: Test installation
run: |
sleep 120
pip install gittrail==${GITHUB_REF:11}
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
flake8
pytest
pytest-cov
twine
wheel

0 comments on commit de15ace

Please sign in to comment.