Skip to content

CD Release TESTPYPI #35

CD Release TESTPYPI

CD Release TESTPYPI #35

name: CD Release TESTPYPI
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Semantic version of the release'
required: true
target_branch:
description: "The branch to release from"
type: string
required: true
jobs:
cdReleaseTestpypi:
runs-on: ubuntu-latest
name: Release
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
ref: ${{ inputs.target_branch }}
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Bump version
shell: bash
run: |
git checkout -b dummy_release/$RELEASE_VERSION
git config --global user.email "[email protected]"
git config --global user.name "Teradata GitHub Actions"
bumpversion --tag --commit --new-version $RELEASE_VERSION num
git push --set-upstream origin dummy_release/$RELEASE_VERSION
env:
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }}
- name: Upload to PyPi
shell: bash
run: |
rm -fr dist/*
python setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TESTPYPI_TOKEN }}
- name: Delete dummy branch
shell: bash
run: |
git checkout main
git branch --delete dummy_release/$RELEASE_VERSION
env:
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }}