-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 2.09 KB
/
release.yaml
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
name: release
on:
workflow_dispatch:
inputs:
whtRelease:
description: 'The wht release, e.g. v0.0.1-rc.1'
required: true
type: string
releaseRef:
description: 'The branch from which the release will be created'
required: true
type: string
default: 'main'
jobs:
release:
name: release
runs-on: ubuntu-latest
env:
VERSION: ${{ inputs.whtRelease }}
GH_TOKEN: ${{ secrets.PAT }}
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
continue-on-error: true
with:
ref: ${{ inputs.releaseRef }}
fetch-depth: 0
# If releaseRef doesn't exist checkout the `main` branch
- name: fallback to main
if: steps.checkout.outcome == 'failure'
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: setup git config
run: |
git config --global user.email "[email protected]"
git config --global user.name "devops-github-rudderstack"
- name: set version and create tag
run: |
VERS=$VERSION make update_version
git add . && git commit -m "chore: release ${VERSION}"
git tag -a ${VERSION} -m "release ${VERSION}"
- name: pip install
shell: bash
run: pip install wheel setuptools
- name: build profiles-pycorelib wheel
shell: bash
run: |
python setup.py bdist_wheel
- name: prepare dist archive
shell: bash
run: |
ls -la
ls -la dist
tar -czvf profiles_pycorelib_dist_${VERSION}.tar.gz dist
- name: push tag and create release
shell: bash
run: |
git push origin ${VERSION}
gh release create ${VERSION} $(echo $VERSION | grep -q "alpha\|beta\|rc" && echo "-p") --generate-notes profiles_pycorelib_dist_${VERSION}.tar.gz dist/*.whl
git push origin HEAD