-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
26 changed files
with
693 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,41 +4,51 @@ on: | |
push: | ||
branches: | ||
- main | ||
- master | ||
- hotfix/* | ||
- develop | ||
- release/* | ||
pull_request: | ||
branches: | ||
- main | ||
- master | ||
- develop | ||
|
||
jobs: | ||
build-ikvm-maven: | ||
name: Build IKVM.Maven (Windows) | ||
runs-on: windows-latest | ||
build: | ||
name: Build | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: 5.x | ||
- name: Execute GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
- name: Move Temporary Directory | ||
shell: pwsh | ||
run: Add-Content $env:GITHUB_ENV "`nTMP=${{ runner.temp }}`nTEMP=${{ runner.temp }}`nTMPDIR=${{ runner.temp }}" | ||
- name: Setup .NET | ||
shell: pwsh | ||
run: Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=${{ runner.temp }}\dotnet" | ||
- name: Setup .NET 3.1 | ||
uses: actions/setup-dotnet@v2 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Setup .NET 6.0 | ||
uses: actions/setup-dotnet@v2 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.0.x | ||
- name: Setup NuGet | ||
- name: Setup .NET 7.0 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: 5.x | ||
- name: Execute GitVersion | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
- name: Move NuGet Directory | ||
shell: pwsh | ||
run: Add-Content $env:GITHUB_ENV "`nNUGET_PACKAGES=${{ runner.temp }}\nuget\packages" | ||
- name: Add NuGet Source (GitHub) | ||
|
@@ -53,61 +63,80 @@ jobs: | |
path: ${{ runner.temp }}\nuget\packages | ||
key: ${{ runner.os }}-nuget-${{ hashFiles('**\*.csproj', '**\*.msbuildproj') }}-1 | ||
restore-keys: ${{ runner.os }}-nuget- | ||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
- name: NuGet Restore | ||
run: dotnet restore IKVM.Maven.sln | ||
- name: Build Artifacts | ||
- name: Build | ||
run: | | ||
msbuild /m:1 ` | ||
/p:BuildInParallel=false ` | ||
/p:CreateHardLinksForAdditionalFilesIfPossible=true ` | ||
/p:CreateHardLinksForCopyAdditionalFilesIfPossible=true ` | ||
/p:CreateHardLinksForCopyFilesToOutputDirectoryIfPossible=true ` | ||
/p:CreateHardLinksForCopyLocalIfPossible=true ` | ||
/p:CreateHardLinksForPublishFilesIfPossible=true ` | ||
/p:ContinuousIntegrationBuild=true ` | ||
dotnet msbuild /m /bl ` | ||
/p:Configuration="Release" ` | ||
/p:Platform="Any CPU" ` | ||
/p:Version=${env:GitVersion_FullSemVer} ` | ||
/p:AssemblyVersion=${env:GitVersion_AssemblyFileVer} ` | ||
/p:AssemblyVersion=${env:GitVersion_AssemblySemVer} ` | ||
/p:InformationalVersion=${env:GitVersion_InformationalVersion} ` | ||
/p:FileVersion=${env:GitVersion_AssemblySemFileVer} ` | ||
/p:PackageVersion=${env:GitVersion_NuGetVersionV2} ` | ||
/p:RepositoryUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}.git" ` | ||
/p:PackageProjectUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}" ` | ||
IKVM.Maven.artifacts.msbuildproj | ||
/p:BuildInParallel=true ` | ||
/p:CreateHardLinksForAdditionalFilesIfPossible=true ` | ||
/p:CreateHardLinksForCopyAdditionalFilesIfPossible=true ` | ||
/p:CreateHardLinksForCopyFilesToOutputDirectoryIfPossible=true ` | ||
/p:CreateHardLinksForCopyLocalIfPossible=true ` | ||
/p:CreateHardLinksForPublishFilesIfPossible=true ` | ||
/p:ContinuousIntegrationBuild=true ` | ||
IKVM.Maven.dist.msbuildproj | ||
- name: Upload MSBuild Log | ||
if: ${{ always() }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: msbuild.binlog | ||
path: msbuild.binlog | ||
- name: Upload NuGet Packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: nuget | ||
path: build/nuget | ||
path: dist/nuget | ||
- name: Package Tests | ||
run: tar czvf tests.tar.gz tests | ||
working-directory: build | ||
working-directory: dist | ||
- name: Upload Tests | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: tests | ||
path: build/tests.tar.gz | ||
test-ikvm-maven-windows: | ||
name: Test IKVM.Maven (Windows) | ||
path: dist/tests.tar.gz | ||
test: | ||
strategy: | ||
matrix: | ||
sys: | ||
- windows | ||
tfm: | ||
- net48 | ||
- netcoreapp3.1 | ||
- net6.0 | ||
- net7.0 | ||
exclude: | ||
- tfm: net48 | ||
sys: linux | ||
name: Test (${{ matrix.sys }}:${{ matrix.tfm }}) | ||
needs: | ||
- build-ikvm-maven | ||
runs-on: windows-latest | ||
- build | ||
runs-on: ${{ fromJSON('{"windows":["windows-2022"],"linux":["ubuntu-22.04"]}')[matrix.sys] }} | ||
steps: | ||
- name: Setup .NET | ||
shell: pwsh | ||
run: Add-Content $env:GITHUB_ENV "`nDOTNET_INSTALL_DIR=${{ runner.temp }}/dotnet" | ||
- name: Setup .NET 3.1 | ||
uses: actions/setup-dotnet@v2 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 3.1.x | ||
- name: Setup .NET 5.0 | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: 5.0.x | ||
- name: Setup .NET 6.0 | ||
uses: actions/setup-dotnet@v2 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.0.x | ||
- name: Setup .NET 7.0 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Setup NuGet | ||
shell: pwsh | ||
run: Add-Content $env:GITHUB_ENV "`nNUGET_PACKAGES=${{ runner.temp }}\nuget\packages" | ||
|
@@ -121,115 +150,84 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: tests | ||
path: build | ||
path: dist | ||
- name: Restore Tests | ||
run: tar xzvf tests.tar.gz | ||
working-directory: build | ||
working-directory: dist | ||
- name: Execute Tests | ||
timeout-minutes: 120 | ||
shell: pwsh | ||
run: gci .\build\tests\ -Recurse -Filter '*.Tests.dll' | group { $_.Directory.BaseName } | %{ dotnet test $_.Group --blame -v 3 --results-directory .\TestResults --logger "trx;LogFileName=$($_.Name).trx" } | ||
run: | | ||
$tfm = "${{ matrix.tfm }}" | ||
$sys = "${{ matrix.sys }}" | ||
$tests = $(gci .\dist\tests\*\$tfm -Recurse -Filter '*.Tests.dll') | ||
if ($tests) { | ||
Add-Content $env:GITHUB_ENV "`nRET=TestResults--$tfm--$sys" | ||
dotnet test -f $tfm --blame -v 2 --results-directory "TestResults" --logger:"console;verbosity=detailed" --logger:trx --collect "Code Coverage" $tests | ||
} | ||
- name: Upload Test Results | ||
if: always() && startsWith(env.RET, 'TestResults--') | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: TestResults-windows | ||
name: ${{ env.RET }} | ||
path: TestResults | ||
#test-ikvm-maven-linux: | ||
# name: Test IKVM.Maven.Sdk (Linux) | ||
# needs: | ||
# - build-ikvm-maven | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Setup .NET 3.1 | ||
# uses: actions/setup-dotnet@v2 | ||
# with: | ||
# dotnet-version: 3.1.x | ||
# - name: Setup .NET 5.0 | ||
# uses: actions/setup-dotnet@v2 | ||
# with: | ||
# dotnet-version: 5.0.x | ||
# - name: Setup .NET 6.0 | ||
# uses: actions/setup-dotnet@v2 | ||
# with: | ||
# dotnet-version: 6.0.x | ||
# - name: Setup NuGet | ||
# shell: pwsh | ||
# run: Add-Content $env:GITHUB_ENV "`nNUGET_PACKAGES=${{ runner.temp }}/nuget/packages" | ||
# - name: Add NuGet Source (GitHub) | ||
# shell: pwsh | ||
# run: dotnet nuget add source --username USERNAME --password $env:GITHUB_TOKEN --store-password-in-clear-text --name ikvm $env:GITHUB_REPOS | ||
# env: | ||
# GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# - name: Download Tests | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: tests | ||
# path: build | ||
# - name: Restore Tests | ||
# run: tar xzvf tests.tar.gz | ||
# working-directory: build | ||
# - name: Execute Tests | ||
# shell: pwsh | ||
# run: gci ./build/tests/ -Recurse -Filter '*.Tests.dll' | group { $_.Directory.BaseName } | ?{ $_.Name -ne 'net461' } | %{ dotnet test $_.Group --blame -v 3 --results-directory ./TestResults --logger "trx;LogFileName=$($_.Name).trx" } | ||
# - name: Upload Test Results | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: TestResults-linux | ||
# path: TestResults | ||
release: | ||
name: Release | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' | ||
needs: | ||
- test-ikvm-maven-windows | ||
#- test-ikvm-maven-linux | ||
runs-on: ubuntu-latest | ||
- test | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout Source | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup .NET 7.0 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Install GitVersion | ||
uses: gittools/actions/gitversion/[email protected].13 | ||
uses: gittools/actions/gitversion/[email protected].15 | ||
with: | ||
versionSpec: 5.x | ||
- name: Execute GitVersion | ||
id: GitVersion | ||
uses: gittools/actions/gitversion/[email protected].13 | ||
uses: gittools/actions/gitversion/[email protected].15 | ||
with: | ||
useConfigFile: true | ||
- name: Download NuGet Packages | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: nuget | ||
path: build/nuget | ||
path: dist/nuget | ||
- name: Create Release | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event.head_commit.message == '+prerelease' | ||
uses: ncipollo/release-action@v1.10.0 | ||
uses: ncipollo/release-action@v1.11.2 | ||
with: | ||
tag: ${{ steps.GitVersion.outputs.semVer }} | ||
artifacts: build/nuget/*.nupkg,build/nuget/*.snupkg | ||
artifacts: dist/nuget/*.nupkg,dist/nuget/*.snupkg | ||
draft: false | ||
generateReleaseNotes: true | ||
prerelease: ${{ github.ref == 'refs/heads/develop' }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push NuGet (GitHub) | ||
shell: pwsh | ||
run: dotnet nuget push build/nuget/*.nupkg --source $env:GITHUB_REPOS --api-key $env:GITHUB_TOKEN --skip-duplicate | ||
run: dotnet nuget push dist/nuget/*.nupkg --source $env:GITHUB_REPOS --api-key $env:GITHUB_TOKEN --skip-duplicate | ||
env: | ||
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Push NuGet (Azure DevOps) | ||
shell: pwsh | ||
run: | | ||
dotnet nuget add source $env:AZUREDEVOPS_REPOS --name az --username az --password $env:AZUREDEVOPS_TOKEN --store-password-in-clear-text | ||
dotnet nuget push build/nuget/*.nupkg --source az --api-key az --skip-duplicate | ||
dotnet nuget push dist/nuget/*.nupkg --source az --api-key az --skip-duplicate | ||
env: | ||
AZUREDEVOPS_REPOS: https://pkgs.dev.azure.com/ikvm-revived/ikvm/_packaging/ikvm-ci/nuget/v3/index.json | ||
AZUREDEVOPS_TOKEN: ${{ secrets.AZUREDEVOPS_PAT }} | ||
- name: Push NuGet | ||
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.event.head_commit.message == '+prerelease' | ||
shell: pwsh | ||
run: dotnet nuget push build/nuget/*.nupkg --source $env:NUGET_REPOS --api-key $env:NUGET_TOKEN --skip-duplicate | ||
run: dotnet nuget push dist/nuget/*.nupkg --source $env:NUGET_REPOS --api-key $env:NUGET_TOKEN --skip-duplicate | ||
env: | ||
NUGET_REPOS: https://api.nuget.org/v3/index.json | ||
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,4 +242,5 @@ ModelManifest.xml | |
.fake/ | ||
|
||
# Ignore build output | ||
build/ | ||
/dist/ | ||
/msbuild.binlog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.