Skip to content

Commit 8edd477

Browse files
Adding Test.yml to test new package of NuGet
1 parent 0507ea8 commit 8edd477

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/Test.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: CD
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
TITLE: "Thread-Safe Objects"
9+
DESCRIPTION: "A combination of generic Thread-Safe objects for .Net development."
10+
TAGS: "thunderdesign 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 threading bindable binding"
11+
#FILE_NAME: ex: "ThunderDesign.Net-PCL.Threading"
12+
FILE_NAME: "${{ github.event.repository.name }}"
13+
#REPOSITORY_NAME: ex: "ThunderDesign.Net-PCL.Threading"
14+
REPOSITORY_NAME: ${{ github.event.repository.name }}
15+
#REPOSITORY_OWNER: ex: "ThunderDesign"
16+
REPOSITORY_OWNER: ${{ github.repository_owner }}
17+
#GITHUB_URL: ex: "https://github.com/ThunderDesign"
18+
GITHUB_URL: ${{ github.server_url }}/${{ github.repository_owner }}
19+
#REPOSITORY_URL: ex: "https://github.com/ThunderDesign/ThunderDesign.Net-PCL.Threading"
20+
REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository_owner }}/${{ github.event.repository.name }}
21+
22+
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
23+
24+
jobs:
25+
pack:
26+
27+
runs-on: [windows-2019]
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Setup .NET 2.0
34+
uses: actions/setup-dotnet@v1
35+
with:
36+
dotnet-version: 2.0.x
37+
38+
- name: Setup MSBuild
39+
uses: microsoft/setup-msbuild@v1.1
40+
41+
- name: Setup NuGet
42+
uses: NuGet/setup-nuget@v1.0.5
43+
44+
- name: Restore NuGet packages.sln
45+
run: nuget restore ./src/${{ env.FILE_NAME}}.sln
46+
47+
- name: Build Solution
48+
run: msbuild ./src/${{ env.FILE_NAME}}.sln /p:Configuration=Release
49+
50+
- name: Prepare .nuspec
51+
run: |
52+
$nuspec = Get-Content ThunderDesign.Net-PCL.nuspec.in
53+
$nuspec = $nuspec -replace '\$\{\{ env.FILE_NAME \}\}', '${{ env.FILE_NAME }}'
54+
$nuspec = $nuspec -replace '\$\{\{ env.TITLE \}\}', '${{ env.TITLE }}'
55+
$nuspec = $nuspec -replace '\$\{\{ env.DESCRIPTION \}\}', '${{ env.DESCRIPTION }}'
56+
$nuspec = $nuspec -replace '\$\{\{ env.TAGS \}\}', '${{ env.TAGS }}'
57+
$nuspec = $nuspec -replace '\$\{\{ env.GITHUB_URL \}\}', '${{ env.GITHUB_URL }}'
58+
$nuspec = $nuspec -replace '\$\{\{ env.REPOSITORY_URL \}\}', '${{ env.REPOSITORY_URL }}'
59+
Set-Content ThunderDesign.Net-PCL.nuspec $nuspec
60+
shell: pwsh
61+
62+
- name: Create NuGet Package
63+
run: nuget pack ThunderDesign.Net-PCL.nuspec -Version ${{ github.event.release.tag_name }} -OutputDirectory ${{ env.PACKAGE_OUTPUT_DIRECTORY }}
64+
65+
- name: Archive NuGet Package
66+
uses: actions/upload-artifact@v2.3.1
67+
with:
68+
name: Package_${{ env.FILE_NAME}}.${{ github.event.release.tag_name }}
69+
path: ${{ env.PACKAGE_OUTPUT_DIRECTORY}}\${{ env.FILE_NAME}}.${{ github.event.release.tag_name }}.nupkg

0 commit comments

Comments
 (0)