Skip to content

Commit a21a996

Browse files
committed
Use branch name to compute release version number
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
1 parent c07c302 commit a21a996

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

.github/workflows/build-installers.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,18 @@ jobs:
2222
- name: Install dependencies
2323
run: dotnet restore --force
2424

25+
- name: Compute Scalar Version
26+
run: |
27+
BRANCH=$(git branch --show-current)
28+
if [ "${BRANCH:0:9" = "releases/" ]; then
29+
VERSION="${BRANCH:9}".0
30+
else
31+
VERSION=0.3.132.0
32+
fi
33+
export VERSION
34+
2535
- name: Build Linux packages
26-
run: dotnet publish -c Release 'Scalar.Packaging.Linux/Scalar.Packaging.Linux.csproj'
36+
run: dotnet publish -c Release -p:ScalarVersion=$VERSION 'Scalar.Packaging.Linux/Scalar.Packaging.Linux.csproj'
2737

2838
# Because the actions/upload-artifact action does not allow you to specify
2939
# relative file paths we must first use a shell script to copy the

Scalar.Packaging.Linux/Scalar.Packaging.Linux.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
Targets="Publish"
2121
Properties="
2222
Configuration=$(Configuration);
23+
ScalarVersion=$(ScalarVersion);
2324
RuntimeIdentifier=$(RuntimeIdentifier);"
2425
BuildInParallel="true" />
2526

0 commit comments

Comments
 (0)