Skip to content

Commit

Permalink
ci/cd: Add package-publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Milind220 authored Mar 8, 2022
1 parent b8d7c9d commit ca39d15
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/package-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This is a basic workflow to help you get started with Actions

name: Workflow to publish Ozone on PyPI and TestPyPI

# Controls when the workflow will run
on:
# Triggers the workflow on release publish
release:
types: [published]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04

steps:
# Steps represent a sequence of tasks that will be executed as part of the job

- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9

- 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/
.
# Publish to Test PyPI and PyPI
- 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/
- 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 ca39d15

Please sign in to comment.