Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9076b7dd3 | |||
| 45d3a08407 | |||
| 399b76e449 | |||
| f8aef65750 | |||
| a797184af8 |
@@ -8,13 +8,6 @@
|
|||||||
"csharpier"
|
"csharpier"
|
||||||
],
|
],
|
||||||
"rollForward": false
|
"rollForward": false
|
||||||
},
|
|
||||||
"gitversion.tool": {
|
|
||||||
"version": "6.1.0",
|
|
||||||
"commands": [
|
|
||||||
"dotnet-gitversion"
|
|
||||||
],
|
|
||||||
"rollForward": false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
@@ -21,9 +19,25 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: ~/.nuget/packages
|
path: ~/.nuget/packages
|
||||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||||
|
|
||||||
|
- id: set-version
|
||||||
|
name: Set version to output
|
||||||
|
run: |
|
||||||
|
SEMVER="3.0.99.${{ github.run_number }}"
|
||||||
|
FILE_VERSION=$(echo "$SEMVER" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
|
||||||
|
FILE_VERSION="$FILE_VERSION.${{ github.run_number }}"
|
||||||
|
|
||||||
|
echo "semver=$SEMVER" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "fileVersion=$FILE_VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
echo $SEMVER
|
||||||
|
echo $FILE_VERSION
|
||||||
|
|
||||||
- name: 🔫 Build All
|
- name: 🔫 Build All
|
||||||
run: ./build.sh
|
run: ./build.sh
|
||||||
|
env:
|
||||||
|
SEMVER: ${{ steps.set-version.outputs.SEMVER }}
|
||||||
|
FILE_VERSION: ${{ steps.set-version.outputs.FILE_VERSION }}
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov with GitHub Action
|
- name: Upload coverage reports to Codecov with GitHub Action
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ name: .NET Build and Publish
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ["main", "dev"]
|
|
||||||
tags: ["3.*"]
|
tags: ["3.*"]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -11,22 +10,40 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup .NET
|
- name: Setup .NET
|
||||||
uses: actions/setup-dotnet@v4
|
uses: actions/setup-dotnet@v4
|
||||||
with:
|
with:
|
||||||
dotnet-version: 8.x.x
|
dotnet-version: 8.x.x
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.nuget/packages
|
path: ~/.nuget/packages
|
||||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||||
|
|
||||||
|
- id: set-version
|
||||||
|
name: Set version to output
|
||||||
|
run: |
|
||||||
|
TAG=${{ github.ref_name }}
|
||||||
|
if [[ "${{ github.ref }}" != refs/tags/* ]]; then
|
||||||
|
TAG="3.0.99.${{ github.run_number }}"
|
||||||
|
fi
|
||||||
|
SEMVER="${TAG}"
|
||||||
|
FILE_VERSION=$(echo "$TAG" | sed -E 's/^([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
|
||||||
|
FILE_VERSION="$FILE_VERSION.${{ github.run_number }}"
|
||||||
|
|
||||||
|
echo "semver=$SEMVER" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "fileVersion=$FILE_VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
echo $SEMVER
|
||||||
|
echo $FILE_VERSION
|
||||||
|
|
||||||
- name: 🔫 Build and Pack
|
- name: 🔫 Build and Pack
|
||||||
run: ./build.sh pack
|
run: ./build.sh pack
|
||||||
|
env:
|
||||||
|
SEMVER: ${{ steps.set-version.outputs.SEMVER }}
|
||||||
|
FILE_VERSION: ${{ steps.set-version.outputs.FILE_VERSION }}
|
||||||
|
|
||||||
- name: Upload coverage reports to Codecov with GitHub Action
|
- name: Upload coverage reports to Codecov with GitHub Action
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
workflow: GitFlow/v1
|
|
||||||
next-version: 3.0.0
|
|
||||||
branches:
|
|
||||||
main:
|
|
||||||
prevent-increment:
|
|
||||||
when-current-commit-tagged: true
|
|
||||||
@@ -23,7 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "config", "config", "{DA2AED
|
|||||||
Directory.Packages.props = Directory.Packages.props
|
Directory.Packages.props = Directory.Packages.props
|
||||||
global.json = global.json
|
global.json = global.json
|
||||||
README.md = README.md
|
README.md = README.md
|
||||||
GitVersion.yml = GitVersion.yml
|
|
||||||
docker-compose.yml = docker-compose.yml
|
docker-compose.yml = docker-compose.yml
|
||||||
CodeMetricsConfig.txt = CodeMetricsConfig.txt
|
CodeMetricsConfig.txt = CodeMetricsConfig.txt
|
||||||
Directory.Build.Targets = Directory.Build.Targets
|
Directory.Build.Targets = Directory.Build.Targets
|
||||||
|
|||||||
+1
-2
@@ -11,7 +11,6 @@
|
|||||||
<File Path="Directory.Build.Targets" />
|
<File Path="Directory.Build.Targets" />
|
||||||
<File Path="Directory.Packages.props" />
|
<File Path="Directory.Packages.props" />
|
||||||
<File Path="docker-compose.yml" />
|
<File Path="docker-compose.yml" />
|
||||||
<File Path="GitVersion.yml" />
|
|
||||||
<File Path="global.json" />
|
<File Path="global.json" />
|
||||||
<File Path="README.md" />
|
<File Path="README.md" />
|
||||||
<File Path=".github\copilot-instructions.md" />
|
<File Path=".github\copilot-instructions.md" />
|
||||||
@@ -43,4 +42,4 @@
|
|||||||
<Project Path="tests/Speckle.Sdk.Serialization.Tests/Speckle.Sdk.Serialization.Tests.csproj" />
|
<Project Path="tests/Speckle.Sdk.Serialization.Tests/Speckle.Sdk.Serialization.Tests.csproj" />
|
||||||
<Project Path="tests/Speckle.Sdk.Tests.Unit/Speckle.Sdk.Tests.Unit.csproj" />
|
<Project Path="tests/Speckle.Sdk.Tests.Unit/Speckle.Sdk.Tests.Unit.csproj" />
|
||||||
</Folder>
|
</Folder>
|
||||||
</Solution>
|
</Solution>
|
||||||
|
|||||||
+8
-10
@@ -1,4 +1,3 @@
|
|||||||
using System.Text.Json;
|
|
||||||
using GlobExpressions;
|
using GlobExpressions;
|
||||||
using static Bullseye.Targets;
|
using static Bullseye.Targets;
|
||||||
using static SimpleExec.Command;
|
using static SimpleExec.Command;
|
||||||
@@ -16,14 +15,13 @@ const string CLEAN_LOCKS = "clean-locks";
|
|||||||
const string PERF = "perf";
|
const string PERF = "perf";
|
||||||
const string DEEP_CLEAN = "deep-clean";
|
const string DEEP_CLEAN = "deep-clean";
|
||||||
|
|
||||||
static async Task<(string, string)> GetVersions()
|
static (string semver, string fileVerison) GetVersions()
|
||||||
{
|
{
|
||||||
var (output, _) = await ReadAsync("dotnet", "dotnet-gitversion /output json").ConfigureAwait(false);
|
string semver =
|
||||||
output = output.Trim();
|
Environment.GetEnvironmentVariable("SEMVER") ?? throw new ArgumentException("Expected SEMVER env var");
|
||||||
var jDoc = JsonDocument.Parse(output);
|
string fileVersion =
|
||||||
var version = jDoc.RootElement.GetProperty("FullSemVer").GetString() ?? "3.0.0-localBuild";
|
Environment.GetEnvironmentVariable("FILE_VERSION") ?? throw new ArgumentException("Expected FILE_VERSION env var");
|
||||||
var fileVersion = jDoc.RootElement.GetProperty("AssemblySemFileVer").GetString() ?? "3.0.0.0";
|
return (semver, fileVersion);
|
||||||
return (version, fileVersion);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Target(
|
Target(
|
||||||
@@ -77,7 +75,7 @@ Target(
|
|||||||
dependsOn: [RESTORE],
|
dependsOn: [RESTORE],
|
||||||
async () =>
|
async () =>
|
||||||
{
|
{
|
||||||
var (version, fileVersion) = await GetVersions().ConfigureAwait(false);
|
var (version, fileVersion) = GetVersions();
|
||||||
Console.WriteLine($"Version: {version} & {fileVersion}");
|
Console.WriteLine($"Version: {version} & {fileVersion}");
|
||||||
await RunAsync(
|
await RunAsync(
|
||||||
"dotnet",
|
"dotnet",
|
||||||
@@ -174,7 +172,7 @@ Target(
|
|||||||
async () =>
|
async () =>
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
var (version, fileVersion) = await GetVersions().ConfigureAwait(false);
|
var (version, fileVersion) = GetVersions();
|
||||||
Console.WriteLine($"Version: {version} & {fileVersion}");
|
Console.WriteLine($"Version: {version} & {fileVersion}");
|
||||||
await RunAsync("dotnet", $"pack Speckle.Sdk.sln -c Release -o output --no-build -p:Version={version}")
|
await RunAsync("dotnet", $"pack Speckle.Sdk.sln -c Release -o output --no-build -p:Version={version}")
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user