Skip to content

Commit af503c7

Browse files
authored
Merge pull request #3 from bbtbir/feature/Workflow
Feature/workflow
2 parents e49cb25 + d098970 commit af503c7

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

.github/workflows/codecov.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
informational: true
6+
patch:
7+
default:
8+
informational: true

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ${{ matrix.os }}
2727
strategy:
2828
matrix:
29-
os: [windows-latest, ubuntu-latest, macos-latest]
29+
os: [ubuntu-latest]
3030

3131
steps:
3232
- uses: actions/checkout@v3

build/GetBuildVersion.psm1

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
Function GetBuildVersion {
2+
Param (
3+
[string]$VersionString
4+
)
5+
6+
# Process through regex
7+
$VersionString -match "(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?(\-(?<pre>[0-9A-Za-z\-\.]+))?(\+(?<build>\d+))?" | Out-Null
8+
9+
if ($matches -eq $null) {
10+
return "1.0.0-build"
11+
}
12+
13+
# Extract the build metadata
14+
$BuildRevision = [uint64]$matches['build']
15+
# Extract the pre-release tag
16+
$PreReleaseTag = [string]$matches['pre']
17+
# Extract the patch
18+
$Patch = [uint64]$matches['patch']
19+
# Extract the minor
20+
$Minor = [uint64]$matches['minor']
21+
# Extract the major
22+
$Major = [uint64]$matches['major']
23+
24+
$Version = [string]$Major + '.' + [string]$Minor + '.' + [string]$Patch;
25+
if ($PreReleaseTag -ne [string]::Empty) {
26+
$Version = $Version + '-' + $PreReleaseTag
27+
}
28+
29+
if ($BuildRevision -ne 0) {
30+
$Version = $Version + '.' + [string]$BuildRevision
31+
}
32+
33+
return $Version
34+
}

0 commit comments

Comments
 (0)