Skip to content

Commit

Permalink
Add GH Action to upload releases to PyPi
Browse files Browse the repository at this point in the history
  • Loading branch information
imphil committed Oct 20, 2021
1 parent 905935b commit 6b4c2bc
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/pypi-upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright cocotb contributors
# Licensed under the Revised BSD License, see LICENSE for details.
# SPDX-License-Identifier: BSD-3-Clause

name: Publish to PyPi

on:
push:
branches:
- master
- 'stable/**'
tags:
- 'v*'

jobs:
pypi-upload:
runs-on: ubuntu-latest
name: deploy
steps:
- uses: actions/checkout@master
with:
# To generate a valid version number setuptools_scm needs sufficient
# git history.
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a source tarball
run: >-
python -m
build
--sdist
--outdir dist/
.
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit 6b4c2bc

Please sign in to comment.