-
Notifications
You must be signed in to change notification settings - Fork 6
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
setup build and deploy action #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set -euo pipefail | ||
|
||
echo "Ensuring pip is up to date" | ||
python -m pip install --upgrade pip | ||
echo "Installing the latest version of pypa/build" | ||
pip install build | ||
|
||
python -m build --sdist --wheel --outdir dist/ . |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: "Build Python package" | ||
description: "Build a wheel and sdist for the package" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Build wheel" | ||
run: "$GITHUB_ACTION_PATH/action.sh" | ||
shell: "bash" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
name: "Verify Python Wheel" | ||
description: "Build a wheel for the package and importing the package doesn't cause an error" | ||
description: "Verify importing the package doesn't cause an error" | ||
inputs: | ||
package-import-name: | ||
description: "Name used to import the package from python code" | ||
required: true | ||
packages-dir: | ||
description: The target directory for distribution | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider wrapping the value in |
||
required: false | ||
default: dist | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Verify wheel" | ||
run: "$GITHUB_ACTION_PATH/action.sh ${{ inputs.package-import-name }}" | ||
run: "$GITHUB_ACTION_PATH/action.sh ${{ inputs.package-import-name }} ${{ inputs.packages-dir }}" | ||
shell: "bash" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish Release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Likewise, consider wrapping all strings in this file in |
||
env: | ||
PYTHON_VERSION: "3.9" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this mean the env that this workflow runs in going to be using Python 3.9? I'm curious if we should be running it in Python 3.8 since we don't add a 3.9 Classifier listing in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I should bump this down cause its just weird, but as we're publishing a pure-python wheel it shouldn't be an issue which version of python builds it |
||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
build-and-publish-wheel-to-pypi: | ||
runs-on: "ubuntu-latest" | ||
environment: "Publish Release" | ||
steps: | ||
- name: "Check out code" | ||
uses: "actions/checkout@v2" | ||
|
||
- uses: "actions/setup-python@v2" | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: "Build wheel" | ||
uses: "./.github/actions/build-dist" | ||
|
||
# v1.4.2 release. Using full SHA for security | ||
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions | ||
- name: "Publish distribution 📦 to PyPI" | ||
uses: "pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29" | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
__version__ = "0.1.0" | ||
|
||
from little_cheesemonger._errors import LittleCheesemongerError # noqa | ||
from little_cheesemonger._run import run # noqa | ||
|
||
__version__ = "0.1.0rc0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,13 @@ long_description = file: README.md | |
long_description_content_type = text/markdown | ||
license = See LICENSE | ||
classifiers = | ||
"Development Status :: 4 - Beta" | ||
"Programming Language :: Python" | ||
"Programming Language :: Python :: 3" | ||
"Programming Language :: Python :: 3.6" | ||
"Programming Language :: Python :: 3.7" | ||
"Programming Language :: Python :: 3.8" | ||
Development Status :: 4 - Beta | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also add a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeppers |
||
Programming Language :: Python :: 3.9 | ||
|
||
[options] | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious why the pip upgrade is triggered with
python -m
and this usespip
straight. Why is that? ❓There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initially implemented by @plannigan so I am unsure!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was actually implemented by @jamescurtin, but it should be the same either way. I don't have an opinion on which should be used going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct: both are the same, I was just inconsistent in usage. (Reference).
python -m pip
has the benefit of being explicit about which version of the python binary is used on a system that uses multiple (i.e.python
vs.python3
), but for our purposes either is fine.