Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions .github/workflows/develop-nuget-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,29 +28,32 @@ jobs:
with:
dotnet-version: 9.0.x

- name: Build (versioning via GitVersion.MsBuild)
run: |
dotnet restore ./Cocoar.Capabilities.slnx
dotnet build -c Release ./Cocoar.Capabilities.slnx
working-directory: ./src
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3
with:
versionSpec: '6.x'

- name: Calculate version
uses: gittools/actions/gitversion/execute@v3
id: gitversion

- name: Log calculated version
run: echo "GitVersion calculated prerelease version ${{ steps.gitversion.outputs.SemVer }}"

- name: Restore dependencies
run: dotnet restore ./Cocoar.Capabilities.slnx
run: dotnet restore
working-directory: ./src

- name: Build solution
run: dotnet build ./Cocoar.Capabilities.slnx -c Release --no-restore
run: dotnet build -c Release --no-restore
working-directory: ./src

- name: Run tests
run: dotnet test ./Cocoar.Capabilities.slnx -c Release --no-build --no-restore --verbosity normal
run: dotnet test -c Release --no-build --no-restore --verbosity normal
working-directory: ./src

- name: Pack NuGet packages (incl. symbols)
run: >
dotnet pack ./Cocoar.Capabilities/Cocoar.Capabilities.csproj -c Release --no-restore
/p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
-o ../artifacts
run: dotnet pack -c Release --no-restore /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg -o ../artifacts
working-directory: ./src

- name: Ensure packages exist
Expand All @@ -62,7 +65,7 @@ jobs:
- name: Upload artifacts (audit)
uses: actions/upload-artifact@v4
with:
name: prerelease-packages
name: prerelease-packages-${{ steps.gitversion.outputs.SemVer }}
path: artifacts
retention-days: 30

Expand Down
30 changes: 17 additions & 13 deletions .github/workflows/develop-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,37 @@ jobs:
with:
dotnet-version: 9.0.x

- name: Log version from GitVersion.MsBuild
run: |
dotnet restore ./Cocoar.Capabilities.slnx
dotnet build -c Release ./Cocoar.Capabilities.slnx > /dev/null
VERSION=$(grep -oP '<GitVersion_SemVer>\K[^<]+' ./Cocoar.Capabilities/obj/Release/*/GitVersion.MsBuild.props | head -n1 || true)
echo "Calculated SemVer: ${VERSION:-unknown}"
working-directory: ./src
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3
with:
versionSpec: '6.x'

- name: Calculate version
uses: gittools/actions/gitversion/execute@v3
id: gitversion

- name: Log calculated version
run: echo "GitVersion calculated version ${{ steps.gitversion.outputs.SemVer }}"

- name: Restore dependencies
run: dotnet restore ./Cocoar.Capabilities.slnx
run: dotnet restore
working-directory: ./src

- name: Build solution
run: dotnet build ./Cocoar.Capabilities.slnx -c Release --no-restore
run: dotnet build -c Release --no-restore
working-directory: ./src

- name: Run tests
run: dotnet test ./Cocoar.Capabilities.slnx -c Release --no-build --no-restore --verbosity normal
run: dotnet test -c Release --no-build --no-restore --verbosity normal
working-directory: ./src

- name: Pack NuGet packages (incl. symbols)
run: dotnet pack ./Cocoar.Capabilities/Cocoar.Capabilities.csproj -c Release --no-restore /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg -o ../artifacts
- name: Pack NuGet packages (testing only)
run: dotnet pack -c Release --no-restore -o ../artifacts
working-directory: ./src

- name: Upload artifacts for testing
uses: actions/upload-artifact@v4
with:
name: prerelease-packages
name: prerelease-packages-${{ steps.gitversion.outputs.SemVer }}
path: artifacts
retention-days: 7
24 changes: 14 additions & 10 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,26 @@ jobs:
with:
dotnet-version: 9.0.x

- name: Log version from GitVersion.MsBuild
run: |
dotnet restore ./Cocoar.Capabilities.slnx
dotnet build -c Release ./Cocoar.Capabilities.slnx > /dev/null
VERSION=$(grep -oP '<GitVersion_SemVer>\K[^<]+' ./Cocoar.Capabilities/obj/Release/*/GitVersion.MsBuild.props | head -n1 || true)
echo "Calculated SemVer: ${VERSION:-unknown}"
working-directory: ./src
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3
with:
versionSpec: '6.x'

- name: Calculate version
uses: gittools/actions/gitversion/execute@v3
id: gitversion

- name: Log calculated version
run: echo "GitVersion calculated version ${{ steps.gitversion.outputs.SemVer }}"

- name: Restore dependencies
run: dotnet restore ./Cocoar.Capabilities.slnx
run: dotnet restore
working-directory: ./src

- name: Build solution
run: dotnet build ./Cocoar.Capabilities.slnx -c Release --no-restore
run: dotnet build -c Release --no-restore
working-directory: ./src

- name: Run tests
run: dotnet test ./Cocoar.Capabilities.slnx -c Release --no-build --no-restore --verbosity normal
run: dotnet test -c Release --no-build --no-restore --verbosity normal
working-directory: ./src
36 changes: 19 additions & 17 deletions .github/workflows/release-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,39 @@ jobs:
with:
dotnet-version: 9.0.x

- name: Extract version from tag
id: extract_version
shell: bash
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v3
with:
versionSpec: '6.x'

- name: Calculate version
id: gitversion
uses: gittools/actions/gitversion/execute@v3

- name: Verify tag matches version
run: |
TAG="${{ github.event.release.tag_name }}"
SEMVER="${{ steps.gitversion.outputs.SemVer }}"
echo "Release tag: $TAG"
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z\.-]+)?$ ]]; then
echo "::error ::Tag must be like vX.Y.Z or vX.Y.Z-<pre>"); exit 1;
echo "GitVersion calculated: $SEMVER"
if [ "v$SEMVER" != "$TAG" ]; then
echo "::error ::Tag ($TAG) does not match GitVersion ($SEMVER)"; exit 1;
fi
SEMVER="${TAG#v}"
echo "SemVer: $SEMVER"
echo "semver=$SEMVER" >> "$GITHUB_OUTPUT"

- name: Restore dependencies
run: dotnet restore ./Cocoar.Capabilities.slnx
run: dotnet restore
working-directory: ./src

- name: Build solution
run: dotnet build ./Cocoar.Capabilities.slnx -c Release --no-restore
run: dotnet build -c Release --no-restore
working-directory: ./src

- name: Run tests
run: dotnet test ./Cocoar.Capabilities.slnx -c Release --no-build --no-restore --verbosity normal
run: dotnet test -c Release --no-build --no-restore --verbosity normal
working-directory: ./src

- name: Pack NuGet packages (incl. symbols)
run: >
dotnet pack ./Cocoar.Capabilities/Cocoar.Capabilities.csproj -c Release --no-restore
/p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg
/p:Version=${{ steps.extract_version.outputs.semver }}
-o ../artifacts
run: dotnet pack -c Release --no-restore /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg -o ../artifacts
working-directory: ./src

- name: Ensure packages exist
Expand All @@ -72,7 +74,7 @@ jobs:
- name: Upload artifacts (audit)
uses: actions/upload-artifact@v4
with:
name: packages-${{ steps.extract_version.outputs.semver }}
name: packages-${{ steps.gitversion.outputs.SemVer }}
path: artifacts
retention-days: 7

Expand Down
5 changes: 1 addition & 4 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
mode: ContinuousDeployment

branches:
main:
regex: ^main$
label: '' # v6 uses 'label' instead of 'tag'
is-main-branch: true # ← use this in v6 (or delete)
develop:
regex: ^develop$
label: alpha
is-main-branch: true
release:
regex: ^release[/-]
label: rc
Expand Down