Skip to content

Commit

Permalink
Merge pull request #329 from unoplatform/dev/jela/nbgv
Browse files Browse the repository at this point in the history
ci: Move to nbgv
  • Loading branch information
jeromelaban authored Jan 24, 2025
2 parents 3978ae3 + d11348b commit c149c5a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 117 deletions.
87 changes: 27 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ on:
schedule:
- cron: '0 0 * * *' # every day at midnight

env:
GitVersion_Version: 5.10.3

concurrency:
group: ${{github.workflow}} - ${{github.ref}}
cancel-in-progress: true
Expand All @@ -37,22 +34,16 @@ jobs:
with:
dotnet-version: '8.0.100'

- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: ${{ env.GitVersion_Version }}

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
id: nbgv
with:
useConfigFile: true
configFilePath: gitversion.yml
toolVersion: 3.6.139
setAllVars: true

- name: Build - CI
run: |
$adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower();
dotnet pack -c Release -p:PackageVersion=$adjustedPackageVersion -p:Version=${{ steps.gitversion.outputs.assemblySemVer }} -o .\artifacts UnoCheck\UnoCheck.csproj
$adjustedPackageVersion="${{ steps.nbgv.outputs.SemVer2 }}".ToLower();
dotnet pack -c Release -p:PackageVersion=$adjustedPackageVersion -p:Version=${{ steps.nbgv.outputs.AssemblyVersion }} -o .\artifacts UnoCheck\UnoCheck.csproj
- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -142,29 +133,17 @@ jobs:
name: NuGet
path: ${{ github.workspace }}\NuGet


- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
id: nbgv
with:
dotnet-version: '3.1.x'

- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: ${{ env.GitVersion_Version }}

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: gitversion.yml
toolVersion: 3.6.139
setAllVars: true

- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
Expand All @@ -174,10 +153,10 @@ jobs:
- name: Install and Run Tool
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ steps.gitversion.outputs.semVer }} --add-source NuGet\ uno.check
& dotnet tool install --global --version ${{ steps.nbgv.outputs.SemVer2 }} --add-source NuGet\ uno.check
& uno-check --ci --fix --non-interactive --verbose --manifest ${{ matrix.manifest }} --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.tool_params }}
testmac:
Expand Down Expand Up @@ -261,23 +240,17 @@ jobs:
# run: |
# dotnet workload install android ios maccatalyst maui tvos macos --source https://api.nuget.org/v3/index.json

- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
id: nbgv
with:
versionSpec: ${{ env.GitVersion_Version }}

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: gitversion.yml
toolVersion: 3.6.139
setAllVars: true

- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
Expand All @@ -287,10 +260,10 @@ jobs:
- name: Install and Run Tool
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ steps.gitversion.outputs.semVer }} --add-source NuGet/ uno.check
& dotnet tool install --global --version ${{ steps.nbgv.outputs.SemVer2 }} --add-source NuGet/ uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 --manifest ${{ matrix.manifest }} ${{ matrix.tool_params }}
testlinux:
Expand Down Expand Up @@ -355,17 +328,11 @@ jobs:
with:
dotnet-version: '8.0.100'

- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: ${{ env.GitVersion_Version }}

- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/[email protected]
- uses: dotnet/nbgv@f088059084cb5d872e9d1a994433ca6440c2bf72 # v0.4.2
id: nbgv
with:
useConfigFile: true
configFilePath: gitversion.yml
toolVersion: 3.6.139
setAllVars: true

- uses: actions/setup-java@v3
with:
Expand All @@ -376,7 +343,7 @@ jobs:
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
Expand All @@ -386,9 +353,9 @@ jobs:
- name: Install and Run Tool
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
Write-Output "PACKAGE VERSION: ${{ steps.nbgv.outputs.SemVer2 }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet tool install --global --version ${{ steps.gitversion.outputs.semVer }} --add-source NuGet/ uno.check
& dotnet tool install --global --version ${{ steps.nbgv.outputs.SemVer2 }} --add-source NuGet/ uno.check
& uno-check --ci --fix --verbose --non-interactive --verbose --manifest ${{ matrix.manifest }} --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.tool_params }}
sign:
Expand Down
57 changes: 0 additions & 57 deletions gitversion.yml

This file was deleted.

22 changes: 22 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.28-dev.{height}",
"versionHeightOffset": 50,
"nuGetPackageVersion": {
"semVer": 2.0
},
"publicReleaseRefSpec": [
"^refs/heads/main$",
"^refs/heads/release/stable/\\d+(?:\\.\\d+)?$"
],
"cloudBuild": {
"setAllVariables": true,
"buildNumber": {
"enabled": true
}
},
"release": {
"branchName": "release/stable/{version}",
"firstUnstableTag": "dev"
}
}

0 comments on commit c149c5a

Please sign in to comment.