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

Add release workflow. #61

Merged
merged 3 commits into from Feb 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,94 @@
name: Build sdist and wheels

on:
workflow_dispatch:
inputs:
upload_to_pypi:
description: "Upload to PyPI? Y/[N]"
default: "N"

jobs:
build_sdist:
name: Build sdist
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.6"

- name: Install pip build
run: |
python -m pip install "build"

- name: Build sdist tarball
shell: bash
run: |
python -m build --sdist .

- uses: actions/upload-artifact@v2
with:
name: sdist
path: |
dist/*.tar.gz
if-no-files-found: error

build_generic_wheel:
name: Build generic wheel (without speedups)
runs-on: ubuntu-latest
env:
# Build a wheel without speedups that can run on pure Python
GENSHI_BUILD_SPEEDUP: 0
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.6"

- name: Install pip build
run: |
python -m pip install "build"

- name: Build wheel
shell: bash
run: |
python -m build --wheel .

- uses: actions/upload-artifact@v2
with:
name: wheels
path: |
dist/*.whl
if-no-files-found: error

deploy:
name: "Upload to PyPI if selected"
if: github.event.inputs.upload_to_pypi == 'Y'
needs: [build_sdist, build_generic_wheel]
runs-on: ubuntu-latest
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_NON_INTERACTIVE: 1
TWINE_REPOSITORY: pypi

steps:
- name: Download build artifacts to local runner
uses: actions/download-artifact@v2

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: "3.10"

- name: Install twine
run: |
python -m pip install "twine"

- name: Upload sdist and wheel to PyPI
run: |
python -m twine upload --verbose wheels/*.whl sdist/*.tar.gz
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
@@ -1,4 +1,4 @@
name: run
name: Run test suite

on: [push, pull_request]

Expand Down
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.