-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (54 loc) · 1.74 KB
/
cd-release-testpypi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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 }}