Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from c2corg/cd-process
Use Gh action to publish releases
- Loading branch information
Showing
5 changed files
with
57 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: continuous-delivery | ||
|
||
on: | ||
push: | ||
branches: | ||
- master' | ||
tags: | ||
- '**' | ||
|
||
|
||
jobs: | ||
build-and-publish: | ||
name: Publish release to Pypi | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
- uses: actions/setup-python@v1 | ||
|
||
- name: Build package | ||
run: | | ||
python --version | ||
pip install -r requirements.txt -r dev-requirements.txt | ||
python setup.py sdist bdist_wheel | ||
- name: Publish package to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.test_pypi_password }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
- name: Test that package is published on Test PyPI | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
pip install --index-url https://test.pypi.org/simple/ --no-deps campbot | ||
- name: Check that version number from source is equal to release version number | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
run: | | ||
echo "Tag name is ${GITHUB_REF##*/}" | ||
python -c "import campbot; print("Version is " + campbot.__version__)" | ||
python -c "import campbot; exit(1 if campbot.__version__ != '${GITHUB_REF##*/}' else 0)" | ||
- name: Publish package to PyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.test_pypi_password }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ | |
""" | ||
|
||
from campbot.core import CampBot | ||
|
||
__version__ = "1.3.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
pytest | ||
pytest-cov | ||
wheel | ||
twine | ||
setuptools |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters