Package Release #15
Workflow file for this 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
name: Package Release | |
on: | |
release: | |
types: [ published ] | |
jobs: | |
release: | |
name: Publish to official pypi | |
runs-on: ${{ matrix.os }} | |
if: ${{ github.repository == 'deepghs/imgutils' }} | |
strategy: | |
matrix: | |
os: | |
- 'ubuntu-latest' | |
python-version: | |
- '3.8' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 20 | |
submodules: 'recursive' | |
- name: Set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up python dependences | |
run: | | |
pip install --upgrade pip | |
pip install --upgrade flake8 setuptools wheel twine | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi | |
pip install --upgrade build | |
- name: Build packages | |
run: | | |
python -m build --sdist --wheel --outdir dist/ | |
- name: Publish distribution 📦 to real PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
password: ${{ secrets.PYPI_PASSWORD }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: dist/* | |
tag: ${{ github.ref }} | |
overwrite: true | |
file_glob: true |