Skip to content

Commit

Permalink
Prepare v0.3.0.rc1 with new release workflow (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiran committed Aug 8, 2022
1 parent 7d8e520 commit db02d2f
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 2 deletions.
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

0 comments on commit db02d2f

Please sign in to comment.