-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pypi-publish workflow Fix linting and update runbook
- Loading branch information
1 parent
ee9e308
commit 6f81cb6
Showing
11 changed files
with
117 additions
and
45 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 |
---|---|---|
@@ -1,34 +1,42 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
|
||
name: pypi-publish | ||
|
||
# Controls when the workflow will run | ||
on: | ||
workflow_dispatch: {} | ||
release: | ||
types: [ published ] | ||
types: | ||
- published | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '**/*.py' | ||
- 'pyproject.toml' | ||
workflow_dispatch: | ||
inputs: | ||
dry_run: | ||
type: choice | ||
description: Dry run mode | ||
required: true | ||
options: | ||
- "true" | ||
- "false" | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
pypi-publisher: | ||
runs-on: thevickypedia-lite | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build twine | ||
- name: Create packages | ||
run: python -m build | ||
- name: Run twine check | ||
run: twine check dist/* | ||
- name: Upload to pypi | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USER }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | ||
run: twine upload dist/*.whl | ||
- name: Set dry-run | ||
run: | | ||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
echo "::notice title=DryRun::Setting dry run to ${{ inputs.dry_run }} for '${{ github.event_name }}' event" | ||
echo "dry_run=${{ inputs.dry_run }}" >> $GITHUB_ENV | ||
elif [[ "${{ github.event_name }}" == "push" ]]; then | ||
echo "::notice title=DryRun::Setting dry run to true for '${{ github.event_name }}' event" | ||
echo "dry_run=true" >> $GITHUB_ENV | ||
else | ||
echo "::notice title=DryRun::Setting dry run to false for '${{ github.event_name }}' event" | ||
echo "dry_run=false" >> $GITHUB_ENV | ||
fi | ||
- uses: thevickypedia/pypi-publisher@v3 | ||
with: | ||
token: ${{ secrets.PYPI_TOKEN }} | ||
dry-run: ${{ env.dry_run }} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
__pycache__/ | ||
.env | ||
.idea | ||
venv | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
fail_fast: true | ||
repos: | ||
- | ||
repo: https://github.com/PyCQA/flake8 | ||
|
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Oops, something went wrong.