- Notifications
You must be signed in to change notification settings - Fork 11
Added release automation (creates drafts automatically and pushes to pypi on release) #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
4 commits Select commit Hold shift + click to select a range
b917c69 [add] Added release automation (creates drafts automatically and push…
filipecosta90 f0d2357 Merge branch 'master' into release.automation
filipecosta90 858ec9b [fix] Fixes per PR review
filipecosta90 cdc83c1 Merge branch 'master' into release.automation
filipecosta90 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,21 @@ | ||
| name-template: 'Version $NEXT_PATCH_VERSION' | ||
| tag-template: 'v$NEXT_PATCH_VERSION' | ||
| categories: | ||
| - title: 'Features' | ||
| labels: | ||
| - 'feature' | ||
| - 'enhancement' | ||
| - title: 'Bug Fixes' | ||
| labels: | ||
| - 'fix' | ||
| - 'bugfix' | ||
| - 'bug' | ||
| - title: 'Maintenance' | ||
| label: 'chore' | ||
| change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
| exclude-labels: | ||
| - 'skip-changelog' | ||
| template: | | ||
| ## Changes | ||
| | ||
| $CHANGES |
This file contains hidden or 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,26 @@ | ||
| | ||
| name: Check if required secrets are set to publish to Pypi | ||
| | ||
| on: push | ||
| | ||
| jobs: | ||
| checksecret: | ||
| name: check if PYPI_TOKEN and TESTPYPI_TOKEN are set in github secrets | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check PYPI_TOKEN | ||
| env: | ||
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
| run: | | ||
| if [ -z "${PYPI_TOKEN}"]; then | ||
| echo "PYPI_TOKEN secret is not set" | ||
| exit 1 | ||
| fi | ||
| - name: Check TESTPYPI_TOKEN | ||
| env: | ||
| TESTPYPI_TOKEN: ${{ secrets.TESTPYPI_TOKEN }} | ||
| run: | | ||
| if [ -z "${TESTPYPI_TOKEN}"]; then | ||
| echo "TESTPYPI_TOKEN secret is not set" | ||
| exit 1 | ||
| fi | ||
This file contains hidden or 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,48 @@ | ||
| name: Publish Pypi | ||
| on: | ||
| release: | ||
| types: [published] | ||
| | ||
| jobs: | ||
| publish: | ||
| name: publish | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@master | ||
| - name: Set up Python 3.6 | ||
| uses: actions/setup-python@v1 | ||
| with: | ||
| python-version: 3.6 | ||
| | ||
| - name: Install twine and wheel | ||
| run: | | ||
| pip install twine wheel | ||
| | ||
| - name: Create a source distribution | ||
| run: | | ||
| python setup.py sdist | ||
| | ||
| - name: Create a wheel | ||
| run: | | ||
| python setup.py bdist_wheel | ||
| | ||
| - name: Create a .pypirc | ||
| run: | | ||
| echo -e "[pypi]" >> ~/.pypirc | ||
| echo -e "username = __token__" >> ~/.pypirc | ||
| echo -e "password = ${{ secrets.PYPI_TOKEN }}" >> ~/.pypirc | ||
| echo -e "[testpypi]" >> ~/.pypirc | ||
| echo -e "username = __token__" >> ~/.pypirc | ||
| echo -e "password = ${{ secrets.TESTPYPI_TOKEN }}" >> ~/.pypirc | ||
filipecosta90 marked this conversation as resolved. Show resolved Hide resolved | ||
| chmod 0600 ~/.pypirc | ||
| | ||
| | ||
| - name: Publish to Test PyPI | ||
| if: github.event_name == 'release' | ||
| run: | | ||
| twine upload --skip-existing -r testpypi dist/* | ||
filipecosta90 marked this conversation as resolved. Show resolved Hide resolved | ||
| | ||
| - name: Publish to PyPI | ||
| if: github.event_name == 'release' | ||
| run: | | ||
| twine upload -r pypi dist/* | ||
This file contains hidden or 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,19 @@ | ||
| name: Release Drafter | ||
| | ||
| on: | ||
| push: | ||
| # branches to consider in the event; optional, defaults to all | ||
| branches: | ||
| - master | ||
| | ||
| jobs: | ||
| update_release_draft: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Drafts your next Release notes as Pull Requests are merged into "master" | ||
| - uses: release-drafter/release-drafter@v5 | ||
| with: | ||
| # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml | ||
| config-name: release-drafter-config.yml | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.