-
Notifications
You must be signed in to change notification settings - Fork 12
42 lines (36 loc) · 1.06 KB
/
Copy pathdevelop-build.yml
File metadata and controls
42 lines (36 loc) · 1.06 KB
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
name: Dev Version on Merge to Develop
on:
pull_request:
branches:
- develop
types:
- closed
permissions:
contents: read
jobs:
dev-version:
if: github.event.pull_request.merged == true
runs-on:
group: databricks-solutions-protected-runner-group
labels: linux-ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Get latest tag
id: get_tag
run: |
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
echo "Latest tag: $TAG"
echo "tag=$TAG" >> $GITHUB_OUTPUT
- name: Generate pre-release version
run: |
TAG=${{ steps.get_tag.outputs.tag }}
VERS=${TAG#v}
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERS"
PATCH=$((PATCH + 1))
SHA=$(git rev-parse --short HEAD)
VERSION="${MAJOR}.${MINOR}.${PATCH}-dev.${SHA}"
echo $VERSION > VERSION
echo "Version: $VERSION"