diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 59c0809780..477cf8eb18 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,18 +40,7 @@ jobs: run: | echo "Adding GNU tar to PATH" echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" - - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 8.0.100 - uses: actions/checkout@v3 - - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('global.json', 'src/**/*.csproj', 'src/**/package.json') }} - name: 'Run: InstallDependencies, Compile, Test, Pack, Publish' run: ./build.cmd InstallDependencies Compile Test Pack Publish env: @@ -59,8 +48,18 @@ jobs: MYGET_API_KEY: ${{ secrets.MYGET_API_KEY }} CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} - - name: 'Publish: artifacts' + - name: 'Publish: NSwag.zip' + uses: actions/upload-artifact@v3 + with: + name: NSwag.zip + path: artifacts/NSwag.zip + - name: 'Publish: NSwag.Npm.zip' + uses: actions/upload-artifact@v3 + with: + name: NSwag.Npm.zip + path: artifacts/NSwag.Npm.zip + - name: 'Publish: NSwagStudio.msi' uses: actions/upload-artifact@v3 with: - name: artifacts - path: artifacts + name: NSwagStudio.msi + path: artifacts/NSwagStudio.msi diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c483a50e68..3cf135f40b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -41,17 +41,6 @@ jobs: run: | echo "Adding GNU tar to PATH" echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%" - - uses: actions/setup-dotnet@v3 - with: - dotnet-version: | - 8.0.100 - uses: actions/checkout@v3 - - name: 'Cache: .nuke/temp, ~/.nuget/packages' - uses: actions/cache@v3 - with: - path: | - .nuke/temp - ~/.nuget/packages - key: ${{ runner.os }}-${{ hashFiles('global.json', 'src/**/*.csproj', 'src/**/package.json') }} - name: 'Run: InstallDependencies, Compile, Test, Pack' run: ./build.cmd InstallDependencies Compile Test Pack diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index b6683d010f..a1ba73863e 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -14,7 +14,7 @@ OnPullRequestExcludePaths = new[] { "**/*.md" }, PublishArtifacts = false, InvokedTargets = new[] { nameof(InstallDependencies), nameof(Compile), nameof(Test), nameof(Pack) }, - CacheKeyFiles = new[] { "global.json", "src/**/*.csproj", "src/**/package.json" }, + CacheKeyFiles = new string[0], JobConcurrencyCancelInProgress = true), ] [CustomGitHubActions( @@ -29,7 +29,7 @@ PublishArtifacts = true, InvokedTargets = new[] { nameof(InstallDependencies), nameof(Compile), nameof(Test), nameof(Pack), nameof(Publish) }, ImportSecrets = new[] { "NUGET_API_KEY", "MYGET_API_KEY", "CHOCO_API_KEY", "NPM_AUTH_TOKEN" }, - CacheKeyFiles = new[] { "global.json", "src/**/*.csproj", "src/**/package.json" }) + CacheKeyFiles = new string[0]) ] public partial class Build { @@ -48,11 +48,13 @@ protected override GitHubActionsJob GetJobs(GitHubActionsImage image, IReadOnlyC var newSteps = new List(job.Steps); // only need to list the ones that are missing from default image + /* newSteps.Insert(0, new GitHubActionsSetupDotNetStep(new[] { "8.0.100" })); - + */ + newSteps.Insert(0, new GitHubActionsUseGnuTarStep()); newSteps.Insert(0, new GitHubActionsConfigureLongPathsStep()); diff --git a/build/Build.Pack.cs b/build/Build.Pack.cs index d58f4d3b73..24776cba32 100644 --- a/build/Build.Pack.cs +++ b/build/Build.Pack.cs @@ -23,7 +23,7 @@ public partial class Build Target Pack => _ => _ .DependsOn(Compile) .After(Test) - .Produces(ArtifactsDirectory / "*.*") + .Produces(ArtifactsDirectory / "NSwag.zip", ArtifactsDirectory / "NSwag.Npm.zip", ArtifactsDirectory / "NSwagStudio.msi") .Executes(() => { if (Configuration != Configuration.Release) @@ -127,6 +127,9 @@ public partial class Build // ZIP directories ZipFile.CreateFromDirectory(NSwagNpmBinaries, ArtifactsDirectory / "NSwag.Npm.zip"); ZipFile.CreateFromDirectory(NSwagStudioBinaries, ArtifactsDirectory / "NSwag.zip"); + + // NSwagStudio.msi + CopyFileToDirectory(ArtifactsDirectory / "bin" / "NSwagStudio.Installer" / Configuration / "NSwagStudio.msi", ArtifactsDirectory); }); }