-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(ci): add semantic versioning and deployment to PYPI
- Loading branch information
1 parent
f489e0c
commit 98af41c
Showing
3 changed files
with
50 additions
and
0 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 |
---|---|---|
|
@@ -24,3 +24,34 @@ jobs: | |
pip install -r dev-requirements.txt | ||
- name: run tests | ||
run: python -m pytest tests/ | ||
|
||
deploy: | ||
name: Deploy to GitHub and PyPI | ||
runs-on: ubuntu-latest | ||
needs: test | ||
if: github.ref == 'refs/heads/master' && github.repository_owner == 'pollination' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: set up node # we need node for for semantic release | ||
uses: actions/[email protected] | ||
with: | ||
node-version: 14.2.0 | ||
- name: install python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -r dev-requirements.txt | ||
- name: install semantic-release | ||
run: | ||
npm install @semantic-release/exec | ||
- name: run semantic release | ||
run: | ||
npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PYPI_USERNAME: ${{ secrets.POLLINATION_PYPI_USERNAME }} | ||
PYPI_PASSWORD: ${{ secrets.POLLINATION_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/exec", | ||
{ | ||
"publishCmd": "bash deploy.sh" | ||
} | ||
] | ||
] | ||
} |
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,6 @@ | ||
#!/bin/sh | ||
|
||
echo "Building distribution" | ||
python setup.py sdist bdist_wheel | ||
echo "Pushing new version to PyPi" | ||
twine upload dist/* -u $PYPI_USERNAME -p $PYPI_PASSWORD |