-
Notifications
You must be signed in to change notification settings - Fork 429
feat: automate publishing to pypi #58
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
Merged
heitorlessa
merged 6 commits into
aws-powertools:develop
from
heitorlessa:feat/automate-pypi-publish
Jun 7, 2020
Merged
Changes from 3 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4f766bb
feat: automate publishing to pypi
heitorlessa 03608c3
feat: ensure version is in package and changelog
heitorlessa ec0933a
feat: sync up master after release
heitorlessa 5456a7a
chore: document release process in action
heitorlessa 53a0fe6
improv: use exact match for release tag version
heitorlessa b2e9b1c
fix: PYPI_USERNAME typo
heitorlessa 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,54 @@ | ||
name: Publish to PyPi | ||
|
||
# only build & publish to PyPi once release notes are published | ||
# this ensures we have release notes correctly, tags, changelog, etc. | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.8" | ||
- name: Set release notes tag | ||
run: | | ||
export RELEASE_TAG_VERSION=${{ github.event.release.tag_name }} | ||
echo ::set-env name=RELEASE_TAG_VERSION::${RELEASE_TAG_VERSION:1} | ||
- name: Ensure new version is also set in pyproject and CHANGELOG | ||
run: | | ||
grep ${RELEASE_TAG_VERSION} CHANGELOG.md | ||
grep ${RELEASE_TAG_VERSION} pyproject.toml | ||
- name: Install dependencies | ||
run: make dev | ||
- name: Run all tests, linting and baselines | ||
run: make pr | ||
- name: Build python package and wheel | ||
run: poetry build | ||
- name: Upload to PyPi test | ||
run: make release-test | ||
env: | ||
PYPI_USERNAME: __token__ | ||
PYPI_TOKEN: ${{ secrets.PYPI_TEST_TOKEN }} | ||
- name: Upload to PyPi prod | ||
run: make release-prod | ||
env: | ||
TWINE_USERNAME: __token__ | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
|
||
sync_master: | ||
needs: upload | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Sync master from detached head | ||
# If version matches CHANGELOG and pyproject.toml | ||
# If it passes all checks, successfully releases to test and prod | ||
# Then sync up master with latest source code release | ||
# where commit message will be Release notes title | ||
run: git push origin HEAD:refs/heads/master --force |
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.