From eed7a9d1e8849649b595848d962fc46d3935c777 Mon Sep 17 00:00:00 2001 From: Tinigrifi Date: Sat, 7 Mar 2026 11:54:26 +0100 Subject: [PATCH] ci: add release workflow triggered on version tags Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..223b430 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: windows-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET 10 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '10.x' + + - name: Restore + run: dotnet restore + + - name: Test + run: dotnet test --configuration Release --verbosity normal + + - name: Publish CLI (CalculateBestDaysOff) + run: | + dotnet publish CalculateBestDaysOff/CalculateBestDaysOff.csproj ` + --configuration Release ` + --runtime win-x64 ` + --self-contained true ` + -p:PublishSingleFile=true ` + --output publish/cli + + - name: Publish WinForms (Conges) + run: | + dotnet publish Conges/Conges.csproj ` + --configuration Release ` + --runtime win-x64 ` + --self-contained true ` + -p:PublishSingleFile=true ` + --output publish/winforms + + - name: Zip CLI + run: Compress-Archive -Path publish/cli/* -DestinationPath CalculateBestDaysOff-${{ github.ref_name }}-win-x64.zip + + - name: Zip WinForms + run: Compress-Archive -Path publish/winforms/* -DestinationPath Conges-${{ github.ref_name }}-win-x64.zip + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + generate_release_notes: true + files: | + CalculateBestDaysOff-${{ github.ref_name }}-win-x64.zip + Conges-${{ github.ref_name }}-win-x64.zip