From 6971c007d84ab6456962bf9731ba3cf59eca97a9 Mon Sep 17 00:00:00 2001 From: David Tchepak Date: Sat, 20 Apr 2024 18:10:21 +1000 Subject: [PATCH 1/3] Release build workflow --- .github/workflows/release_build.yml | 44 +++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/release_build.yml diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml new file mode 100644 index 00000000..93346886 --- /dev/null +++ b/.github/workflows/release_build.yml @@ -0,0 +1,44 @@ +name: Release build +on: + workflow_dispatch: + push: + tags: + - 'v*' + +env: + CONFIGURATION: Release + +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 6.0.x + 7.0.x + 8.0.x + + - name: Setup Ruby for documentation build + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.2' + bundler-cache: true + + - name: Build package and docs + run: dotnet run --project 'build/build.fsproj' -- -t All + + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + path: | + bin/Release/NSubstitute/*.nupkg + bin/Release/NSubstitute/*.snupkg + bin/Release/nsubstitute.github.com/ + From 67c0d2927f78e7c23c307f8ccf5e719d8d6c053c Mon Sep 17 00:00:00 2001 From: David Tchepak Date: Mon, 29 Apr 2024 20:27:58 +1000 Subject: [PATCH 2/3] Release build - apply review comments - Rename workflow - Split artifact upload into packages and docs --- .github/workflows/release_build.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index 93346886..a72d0a84 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -1,4 +1,4 @@ -name: Release build +name: Build release packages and documentation on: workflow_dispatch: push: @@ -34,11 +34,18 @@ jobs: - name: Build package and docs run: dotnet run --project 'build/build.fsproj' -- -t All - - name: Upload artifacts + - name: Upload packages uses: actions/upload-artifact@v4 with: + name: packages path: | bin/Release/NSubstitute/*.nupkg bin/Release/NSubstitute/*.snupkg + + - name: Upload documentation + uses: actions/upload-artifact@v4 + with: + name: docs + path: | bin/Release/nsubstitute.github.com/ From b13091c6948ea5dc7ea8a003dfa64b1fc984a1ae Mon Sep 17 00:00:00 2001 From: David Tchepak Date: Tue, 30 Apr 2024 22:48:58 +1000 Subject: [PATCH 3/3] Change artifact retention on release build --- .github/workflows/release_build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release_build.yml b/.github/workflows/release_build.yml index a72d0a84..7d01d884 100644 --- a/.github/workflows/release_build.yml +++ b/.github/workflows/release_build.yml @@ -41,6 +41,7 @@ jobs: path: | bin/Release/NSubstitute/*.nupkg bin/Release/NSubstitute/*.snupkg + retention-days: 7 - name: Upload documentation uses: actions/upload-artifact@v4 @@ -48,4 +49,5 @@ jobs: name: docs path: | bin/Release/nsubstitute.github.com/ - + retention-days: 7 + compression-level: 9