Skip to content

Commit

Permalink
Added GitHub Actions workflow to publish release on PYPI:
Browse files Browse the repository at this point in the history
- Added workflow
- Updated CONTRIBUTING.md page
  • Loading branch information
abatomunkuev committed Nov 27, 2021
1 parent a5e1d81 commit 3f50a88
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build distribution
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6","3.7"]
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
run: python -m pip install build wheel
- name: Build distributions
shell: bash -l {0}
run: python setup.py sdist bdist_wheel
- name: Publish package to PYPI
if: github.repository == 'abatomunkuev/static_site_generator' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
passwords: ${{secrets.pypi_password}}
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,23 @@ pytest tests/
You can run all the tests and code-formatting in one-step by running:
```
./run_python_tests.sh
```

## Releasing
Releases are published automatically when a tag is pushed to GitHub.
```bash
# Set next version number
export RELEASE=x.x.x

# Create tags
git commit --allow-empty -m "Release $RELEASE"
git tag -a $RELEASE -m "Version $RELEASE"

# Push
git push upstream --tags
```

Pushing upstream assumes we are working from a fork, if we are not doing that that it would be:
```bash
git push origin --tags
```

0 comments on commit 3f50a88

Please sign in to comment.