Skip to content
This repository has been archived by the owner on Sep 1, 2021. It is now read-only.

Commit

Permalink
Update publish GitHub Actions (#204)
Browse files Browse the repository at this point in the history
Signed-off-by: Xiangyu Wang <[email protected]>
  • Loading branch information
Xiangyu Wang authored Jun 28, 2021
1 parent b41f91a commit 83a8273
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 9 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/publish_dev_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish Python 🐍 distributions πŸ“¦ to TestPyPI

on:
push:
branches:
- 'main'

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to TestPyPI
runs-on: ubuntu-18.04

steps:
- name: Check out from Git
uses: actions/checkout@master
- name: Get history and tags for SCM versioning
run: |
git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution πŸ“¦ to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TOKEN_TEST_PYPI }}
repository_url: https://test.pypi.org/legacy/

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
name: Publish Python 🐍 distributions πŸ“¦ to PyPI

on:
push:
branches:
- 'main'
tags:
- 'v2.[0-9]+.[0-9]+**'
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI and TestPyPI
name: Build and publish Python 🐍 distributions πŸ“¦ to PyPI
runs-on: ubuntu-18.04

steps:
Expand Down Expand Up @@ -34,11 +34,6 @@ jobs:
--wheel
--outdir dist/
.
- name: Publish distribution πŸ“¦ to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TOKEN_TEST_PYPI }}
repository_url: https://test.pypi.org/legacy/
- name: Publish distribution πŸ“¦ to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
Expand Down

0 comments on commit 83a8273

Please sign in to comment.