mirror of
https://github.com/drewcassidy/Pillow-mbm.git
synced 2024-09-01 14:44:04 +00:00
Update ci workflow
This commit is contained in:
parent
04abe55969
commit
7b60e9e064
100
.github/workflows/python-publish.yml
vendored
100
.github/workflows/python-publish.yml
vendored
@ -1,37 +1,79 @@
|
|||||||
# This workflow will upload a Python Package using Twine when a release is created
|
# This workflow will upload a Python Package using Twine when a release is created
|
||||||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
|
||||||
|
|
||||||
name: Upload Python Package
|
name: build
|
||||||
on:
|
on: [ push, pull_request ]
|
||||||
release:
|
|
||||||
# Only use the types keyword to narrow down the activity types that will trigger your workflow.
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
test:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up Python
|
|
||||||
uses: actions/setup-python@v2
|
- name: Set up Python
|
||||||
with:
|
uses: actions/setup-python@v2
|
||||||
python-version: '3.x'
|
with:
|
||||||
- name: Install dependencies
|
python-version: '3.x'
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
- name: Install dependencies
|
||||||
pip install setuptools wheel twine
|
run: |
|
||||||
- name: Install pypa/build
|
python -m pip install --upgrade pip
|
||||||
run: python -m pip install build --user
|
python -m pip install flake8
|
||||||
- name: Build a binary wheel and source tarball
|
|
||||||
run: python -m build --sdist --wheel --outdir dist/
|
- name: Install module
|
||||||
- name: Publish to Test PyPI
|
run: python -m pip install .
|
||||||
uses: pypa/gh-action-pypi-publish@master
|
|
||||||
with:
|
- name: Lint with flake8
|
||||||
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
run: |
|
||||||
repository_url: https://test.pypi.org/legacy/
|
# stop the build if there are Python syntax errors or undefined names
|
||||||
- name: Publish to PyPI
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||||
with:
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||||
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
||||||
|
deploy:
|
||||||
|
needs: test
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
||||||
|
|
||||||
|
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
|
||||||
|
python -m pip install setuptools wheel twine
|
||||||
|
python -m pip install yaclog
|
||||||
|
python -m pip install build --user
|
||||||
|
|
||||||
|
- name: Build a binary wheel and source tarball
|
||||||
|
run: python -m build --sdist --wheel --outdir dist/
|
||||||
|
|
||||||
|
- name: Get version name and body
|
||||||
|
run: |
|
||||||
|
echo "VERSION_TILE=$(yaclog show -n)" >> $GITHUB_ENV
|
||||||
|
echo "$(yaclog show -mb)" >> RELEASE.md
|
||||||
|
|
||||||
|
- name: Publish to Test PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@master
|
||||||
|
with:
|
||||||
|
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
|
||||||
|
repository_url: https://test.pypi.org/legacy/
|
||||||
|
|
||||||
|
- name: Publish to PyPI
|
||||||
|
uses: pypa/gh-action-pypi-publish@release/v1
|
||||||
|
with:
|
||||||
|
password: ${{ secrets.PYPI_API_TOKEN }}
|
||||||
|
|
||||||
|
- name: Publish to Github
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
files: dist/*
|
||||||
|
name: ${{ env.VERSION_TITLE }}
|
||||||
|
body_path: RELEASE.md
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue
Block a user