Skip to content

Commit b028fd2

Browse files
author
juanonsoftware
committed
Adding CI for develop branch
1 parent 735966e commit b028fd2

2 files changed

Lines changed: 55 additions & 5 deletions

File tree

.github/workflows/ci-develop.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI on Develop branch
2+
on:
3+
push:
4+
branches: [ develop ]
5+
workflow_dispatch:
6+
7+
jobs:
8+
create-new-tag:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Create new tag
13+
shell: pwsh
14+
run: |
15+
. ./Scripts/VersionManager.ps1
16+
New-Tag -Branch "develop"
17+
Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,39 @@
11
#################################
22
# This script contains funtions to create git tags following GitFlow
33
#################################
4+
function New-Tag
5+
{
6+
param (
7+
[Parameter(Mandatory=$true)]
8+
[string]$Branch
9+
)
10+
11+
$version = Get-CurrentVersion
12+
$patch = Get-NewPatch
13+
$prefix = ""
14+
15+
if ($Branch -eq "release")
16+
{
17+
$version = ([decimal]$currentVersion + 0.1).ToString()
18+
$prefix = "Beta-"
19+
}
20+
if ($Branch -eq "develop")
21+
{
22+
$version = ([decimal]$currentVersion + 0.1).ToString()
23+
$prefix = "Dev-"
24+
}
25+
if ($Branch -eq "hotfix")
26+
{
27+
$version = ([decimal]$currentVersion + 0.1).ToString()
28+
$prefix = "HF-"
29+
}
30+
31+
$tag = "v$version.$prefix$patch"
32+
33+
Invoke-Expression "git tag $tag"
34+
35+
return $tag
36+
}
437

538
function Get-CurrentVersion
639
{
@@ -35,17 +68,17 @@ function Get-CurrentVersion
3568

3669
function Get-NewPatch
3770
{
38-
param (
71+
param (
3972
[Parameter(Mandatory=$false)]
4073
[string]$Prefix = ""
4174
)
4275

43-
if ($Prefix -ne "")
76+
if ($Prefix -eq "")
4477
{
45-
return $Prefix + "-" + (Get-Date).ToString("yyMMddhhmmss")
78+
return (Get-Date).ToString("yyMMddhhmmss")
4679
}
4780

48-
return (Get-Date).ToString("yyMMddhhmmss")
81+
return $Prefix + "-" + (Get-Date).ToString("yyMMddhhmmss")
4982
}
5083

5184
function Get-NextVersion
@@ -58,4 +91,4 @@ function Get-GitTags
5891
{
5992
$tags = Invoke-Expression "git tag --list"
6093
$tags
61-
}
94+
}

0 commit comments

Comments
 (0)