Skip to content

Release

Release #41

Workflow file for this run

name: Release
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
branch:
description: 'Tag or branch to build'
required: true
skip_test:
description: 'Type "skip" to bypass test.pypi push'
required: true
default: run
official:
description: 'Type "PUBLISH TO PYPI" to do an official pypi release'
required: true
default: test
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch }}
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install anybadge
python -m pip install .
- name: Build the release tarball
run: |
python -m pip install --upgrade pip setuptools wheel build
python3 -m build --wheel --sdist
- name: Publish distribution 📦 to Test PyPI
if: github.event.inputs.skip_test != 'skip'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Archive release tarball
uses: actions/upload-artifact@v2
with:
name: release-tarball
path: dist/truvari*.tar.gz
# if-no-files-found: ignore
- name: Publish distribution 📦 to PyPI
if: github.event.inputs.official == 'PUBLISH TO PYPI'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}