chore(deps)(deps): Bump actions/download-artifact from 7 to 8 (#51) #120
This file contains hidden or 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
| # This workflow will build a .NET project | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net | |
| name: .NET | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| tags: | |
| - 'v*' | |
| - 'V*' | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: write # Needed to create releases and upload assets | |
| pull-requests: read # Needed for PR workflows | |
| jobs: | |
| build: | |
| runs-on: windows-latest # For a list of available runner types, refer to | |
| # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 # Récupère tout l'historique pour GitVersion | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v3 | |
| with: | |
| versionSpec: '5.x' | |
| - name: Determine Version | |
| uses: gittools/actions/gitversion/execute@v3 | |
| id: gitversion | |
| - name: Display GitVersion outputs | |
| run: | | |
| echo "Version: ${{ steps.gitversion.outputs.semVer }}" | |
| echo "AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}" | |
| echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}" | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build -c Release --no-restore | |
| - name: Test | |
| run: dotnet test -c Release --no-build --verbosity normal | |
| - name: Create NuGet Package | |
| run: dotnet pack PCTTools\PCTTools.csproj -c Release --no-build -o . | |
| - name: 'Upload Build Artifact' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: PCTTools-${{ steps.gitversion.outputs.semVer }} | |
| path: | | |
| PCTTools\bin\Release\netstandard2.0\PCTTools.dll | |
| PCTTools\bin\Release\netstandard2.0\PCTTools.pdb | |
| - name: 'Upload NuGet Package' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: PCTTools-NuGet-${{ steps.gitversion.outputs.semVer }} | |
| path: "*.nupkg" | |
| release: | |
| needs: build | |
| runs-on: windows-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install GitVersion | |
| uses: gittools/actions/gitversion/setup@v3 | |
| with: | |
| versionSpec: '5.x' | |
| - name: Determine Version | |
| uses: gittools/actions/gitversion/execute@v3 | |
| id: gitversion | |
| - name: Download Build Artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: PCTTools-${{ steps.gitversion.outputs.semVer }} | |
| path: ./artifacts | |
| - name: Download NuGet Package | |
| uses: actions/download-artifact@v8 | |
| with: | |
| name: PCTTools-NuGet-${{ steps.gitversion.outputs.semVer }} | |
| path: ./nuget-package | |
| - name: Create Release Package | |
| run: | | |
| mkdir release-package | |
| Copy-Item "artifacts\PCTTools.dll" -Destination "release-package\" | |
| Copy-Item "artifacts\PCTTools.pdb" -Destination "release-package\" | |
| Copy-Item "README.md" -Destination "release-package\" -ErrorAction SilentlyContinue | |
| Copy-Item "LICENSE" -Destination "release-package\" -ErrorAction SilentlyContinue | |
| Compress-Archive -Path "release-package\*" -DestinationPath "PCTTools-${{ steps.gitversion.outputs.semVer }}.zip" | |
| - name: Generate Release Notes | |
| id: release_notes | |
| run: | | |
| $tag = "${{ github.ref_name }}" | |
| $version = "${{ steps.gitversion.outputs.semVer }}" | |
| $releaseNotes = @" | |
| # PCTTools $version | |
| ## 📦 Artifacts | |
| - **PCTTools.dll** : Main library | |
| - **PCTTools.pdb** : Debug symbols | |
| - **PCTTools-$version.zip** : Complete package with library and documentation | |
| - **PCTTools.$version.nupkg** : NuGet package for easy installation | |
| ## 📋 Changes | |
| See commit history for detailed changes. | |
| --- | |
| **Version automatically generated on $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')** | |
| "@ | |
| # Échapper les caractères spéciaux pour GitHub Actions | |
| $releaseNotes = $releaseNotes -replace "`r`n", "`n" | |
| echo "RELEASE_NOTES<<EOF" >> $env:GITHUB_OUTPUT | |
| echo $releaseNotes >> $env:GITHUB_OUTPUT | |
| echo "EOF" >> $env:GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: PCTTools ${{ steps.gitversion.outputs.semVer }} | |
| body: ${{ steps.release_notes.outputs.RELEASE_NOTES }} | |
| draft: false | |
| prerelease: ${{ contains(steps.gitversion.outputs.semVer, '-') }} | |
| files: | | |
| artifacts/PCTTools.dll | |
| artifacts/PCTTools.pdb | |
| PCTTools-${{ steps.gitversion.outputs.semVer }}.zip | |
| nuget-package/*.nupkg | |
| token: ${{ secrets.GITHUB_TOKEN }} |