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

Prepare v0.3.0.rc1 with new release workflow #3

Merged
merged 1 commit into from
Aug 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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: CI

on:
push:
branches: [ "master", "v*" ]
branches: [ "main", "v*" ]
pull_request:
branches: [ "master", "v*" ]
branches: [ "main", "v*" ]
workflow_dispatch:

permissions:
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name: Build and upload to PyPI

permissions:
contents: read

on:
workflow_dispatch:
inputs:
tag:
description: tag to build
required: true
type: string
testpypi:
description: upload to Test PyPI
type: boolean
default: false
pypi:
description: upload to PyPI
type: boolean
default: false

jobs:
tests:
uses: /.github/workflows/main.yml
pypi:
name: Build and upload to PyPI
runs-on: ubuntu-latest
needs: tests
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag || github.ref }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: "Update pip"
run: python -m pip install --upgrade pip setuptools wheel
- name: "Install 'build' and 'twine'"
run: python -m pip install --upgrade build twine
- name: "Run 'build'"
run: "python -m build"
- name: "Run twine check"
run: "python -m twine check dist/*"
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
if: inputs.testpypi || false
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
if: inputs.pypi || false