-
Notifications
You must be signed in to change notification settings - Fork 16
76 lines (75 loc) · 2.52 KB
/
cd-release.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CD Release
on:
workflow_dispatch:
inputs:
releaseVersion:
description: 'Semantic version of the release'
required: true
jobs:
cdRelease:
runs-on: ubuntu-latest
name: Release
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.GH_TOKEN }}
- 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 releases/$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 releases/$RELEASE_VERSION
git push --tags
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 dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: v${{ github.event.inputs.releaseVersion }}
release_name: dbt-teradata v${{ github.event.inputs.releaseVersion }}
body_path: ./CHANGELOG.md
draft: false
prerelease: false
- name: reset changelog
shell: bash
run: |
git checkout main
cp CHANGELOG.md.template CHANGELOG.md
git add CHANGELOG.md
git commit -m "resetting CHANGELOG.md for the next release"
git push
- name: changing dockerfile version
shell: bash
run: |
git checkout main
sed -i "48s/.*/RUN python -m pip install dbt-teradata==$RELEASE_VERSION/g" docker/Dockerfile
if [[ "$RELEASE_VERSION" == "1.8"* ]] || [[ "$RELEASE_VERSION" > "1.8" ]]; then
echo "RUN python -m pip install dbt-core>=1.8.0" >> docker/Dockerfile
fi
git add docker/Dockerfile
git commit -m "syncing version in Docker file"
git push
env:
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }}