Skip to content

Commit 0183441

Browse files
authored
Add workflow that tags a version bump (#481)
1 parent 8019bc4 commit 0183441

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/tag.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Tag new version
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths:
7+
- 'databricks_cli/version.py'
8+
9+
jobs:
10+
tag:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: "3.10"
20+
21+
- name: Check if this is a release version
22+
id: version
23+
env:
24+
PYTHONPATH: /home/runner/work/databricks-cli/databricks-cli
25+
shell: python
26+
run: |
27+
from databricks_cli.version import version, is_release_version
28+
print("::set-output name=version::" + version)
29+
if is_release_version():
30+
print("::set-output name=is_release_version::true")
31+
print("Release version: " + version)
32+
else:
33+
print("::set-output name=is_release_version::false")
34+
print("Not a release version: " + version)
35+
36+
- name: Create and push tag
37+
if: steps.version.outputs.is_release_version == 'true'
38+
run: |
39+
git tag ${{ steps.version.outputs.version }}
40+
git push origin ${{ steps.version.outputs.version }}

0 commit comments

Comments
 (0)