diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 5802b54..6804b66 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -2,7 +2,7 @@ name: Build and Test on: push: - branches: [ master ] + branches: [ master, release, prerelease] pull_request: branches: [ master ] @@ -43,3 +43,35 @@ jobs: run: dotnet build --configuration Release --no-restore - name: Test run: dotnet test Ryu.Net.UnitTests/bin/Release/netcoreapp3.1/Ryu.NET.UnitTests.dll + package: + runs-on: ubuntu-latest + needs: [build] + if: github.ref == 'refs/heads/release' || github.ref == 'refs/heads/prerelease' + steps: + - uses: actions/checkout@v2 + - name: Build_Package + run : | + dotnet pack Ryu.Net\\Ryu.NET.csproj -c Release --output=package_output + id : Build_Package + - name: Tag commit + uses: tvdias/github-tagger@v0.0.1 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + tag: "${{ steps.Build_Package.outputs.version }}" + - name: Release + uses: ncipollo/release-action@v1 + with: + artifacts: "package_output/*.nupkg" + prerelease: ${{ github.ref == 'refs/heads/prerelease'}} + draft: false + tag: "${{ steps.Build_Package.outputs.version }}" + token: ${{ secrets.GITHUB_TOKEN }} + - name: Github Package + uses: tanaka-takayoshi/nuget-publish-to-github-packages-action@v2.1 + with: + nupkg-path: "package_output/*.nupkg" + repo-owner: 'Narinder Claire' + gh-user: 'Ninds' + token: ${{ secrets.GITHUB_TOKEN }} + - name: Push with dotnet + run: dotnet nuget push package_output/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json diff --git a/Ryu.NET.sln b/Ryu.NET.sln index d3350e3..9ce7da5 100644 --- a/Ryu.NET.sln +++ b/Ryu.NET.sln @@ -21,6 +21,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenerateD2STestData", "util EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenerateD2SSmallerTestData", "utils\GenerateD2SSmallerTestData\GenerateD2SSmallerTestData.csproj", "{7AC3930A-3079-4CEE-B177-1D56F0AFCF0A}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{5F02CCEA-D3F0-4325-B0EB-7078275235C9}" + ProjectSection(SolutionItems) = preProject + .github\workflows\dotnet-core.yml = .github\workflows\dotnet-core.yml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Ryu.Net/Ryu.NET.csproj b/Ryu.Net/Ryu.NET.csproj index 7796235..26f6247 100644 --- a/Ryu.Net/Ryu.NET.csproj +++ b/Ryu.Net/Ryu.NET.csproj @@ -1,16 +1,24 @@ - + netstandard2.0 latest true - + 0.0.0-dev$([System.DateTime]::Now.ToString(yyMMddhhmm)) + Ryu.NET + + + + https://github.com/Ninds/Ryu.NET + $(GITHUB_SHA) + $(GITHUB_REF) + BSL-1.0 OR Apache-2.0 - - - - + + + + @@ -29,6 +37,18 @@ + + $([System.DateTime]::Now.ToString(yy.MM.dd)) + + + + $([System.DateTime]::Now.ToString(yy.MM.dd))-dev + + + + + + \ No newline at end of file