v1.1.1 #8
Workflow file for this run
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
| name: CD | |
| on: | |
| release: | |
| types: [published] | |
| env: | |
| TITLE: ".NET Development ToolBox" | |
| DESCRIPTION: "A set of core methods and classes to ease every days .NET development tasks." | |
| TAGS: "thunderdesign toolbox visual%2Dstudio c%2Dsharp dotnet%2Dstandard dotnet%2Dframework dotnet%2Dcore cross%2Dplatform pcl%2Dlibrary mono xamarin%2Dforms xamarin%2Dandroid xamarin%2Dios xamarin%2Dmac xamarin%2Duwp unity csharp net dotnet" | |
| #FILE_NAME: ex: "ThunderDesign.Net-PCL.ToolBox" | |
| FILE_NAME: "${{ github.event.repository.name }}" | |
| #REPOSITORY_NAME: ex: "ThunderDesign.Net-PCL.ToolBox" | |
| REPOSITORY_NAME: ${{ github.event.repository.name }} | |
| #REPOSITORY_OWNER: ex: "ThunderDesign" | |
| REPOSITORY_OWNER: ${{ github.repository_owner }} | |
| #GITHUB_URL: ex: "https://github.com/ThunderDesign" | |
| GITHUB_URL: ${{ github.server_url }}/${{ github.repository_owner }} | |
| #REPOSITORY_URL: ex: "https://github.com/ThunderDesign/ThunderDesign.Net-PCL.ToolBox" | |
| REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository_owner }}/${{ github.event.repository.name }} | |
| PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output | |
| jobs: | |
| pack: | |
| runs-on: [windows-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| - name: Install .NET Framework 4.6.1 Developer Pack | |
| run: choco install netfx-4.6.1-devpack -y | |
| - name: Setup .NET 2.0 | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 2.0.x | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v1.1 | |
| - name: Setup NuGet | |
| uses: NuGet/setup-nuget@v1.0.5 | |
| - name: Restore NuGet packages.sln | |
| run: nuget restore ./src/${{ env.FILE_NAME}}.sln | |
| - name: Build Solution | |
| run: msbuild ./src/${{ env.FILE_NAME}}.sln /p:Configuration=Release | |
| - name: Prepare .nuspec | |
| run: | | |
| $nuspecPath = "src/${{ env.FILE_NAME }}.nuspec.in" | |
| $nuspec = Get-Content $nuspecPath | |
| $nuspec = $nuspec -replace '\$\{\{ env.FILE_NAME \}\}', '${{ env.FILE_NAME }}' | |
| $nuspec = $nuspec -replace '\$\{\{ env.TITLE \}\}', '${{ env.TITLE }}' | |
| $nuspec = $nuspec -replace '\$\{\{ env.DESCRIPTION \}\}', '${{ env.DESCRIPTION }}' | |
| $nuspec = $nuspec -replace '\$\{\{ env.TAGS \}\}', '${{ env.TAGS }}' | |
| $nuspec = $nuspec -replace '\$\{\{ env.GITHUB_URL \}\}', '${{ env.GITHUB_URL }}' | |
| $nuspec = $nuspec -replace '\$\{\{ env.REPOSITORY_URL \}\}', '${{ env.REPOSITORY_URL }}' | |
| Set-Content ThunderDesign.Net-PCL.nuspec $nuspec | |
| shell: pwsh | |
| - name: Create NuGet Package | |
| run: nuget pack ThunderDesign.Net-PCL.nuspec -Version ${{ github.event.release.tag_name }} -OutputDirectory ${{ env.PACKAGE_OUTPUT_DIRECTORY }} | |
| - name: Archive NuGet Package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Package_${{ env.FILE_NAME}}.${{ github.event.release.tag_name }} | |
| path: ${{ env.PACKAGE_OUTPUT_DIRECTORY}}\${{ env.FILE_NAME}}.${{ github.event.release.tag_name }}.nupkg | |
| - name: Publish NuGet Package | |
| run: nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY}}\${{ env.FILE_NAME}}.${{ github.event.release.tag_name }}.nupkg -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_API_KEY }} |