Skip to content
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

ci: add release workflow without pypa action #69

Merged
merged 2 commits into from
Sep 10, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Always build and verify our release process, but then also conditionally
# upload to PyPI if a git tag triggered the workflow.
#
name: Release

on:
push:
pull_request:
workflow_dispatch:

jobs:
build-verify-upload-release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8

- name: install dependencies
run: |
pip install --upgrade pip
pip install build twine
pip freeze

- name: build release
run: |
python -m build --sdist --wheel .
ls -l dist

- name: verify release metadata
run: python -m twine check dist/*

- name: upload release to pypi
if: startsWith(github.ref, 'refs/tags/')
run: twine upload --username __token__ --password ${{ secrets.pypi_password }} dist/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use TWINE_USERNAME, TWINE_PASSWORD environment variables? Even though GHA logs hide them, I still feel a bit better passing credentials via env than command-line.

consideRatio marked this conversation as resolved.
Show resolved Hide resolved