Add GithubActions workflow for nugetUpload

This commit is contained in:
Afshin Arani 2020-04-02 18:47:25 +08:00 committed by Andres G. Aragoneses
parent 932a733197
commit 66942979ab
2 changed files with 33 additions and 4 deletions

29
.github/workflows/nugetUpload.yml vendored Normal file
View file

@ -0,0 +1,29 @@
name: nugetUpload
on: [push, pull_request]
env:
NUGET_URL: https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Download Nuget.exe
run: Invoke-WebRequest -OutFile Nuget.exe $Env:NUGET_URL
- name: Install Dependencies
run: ./Nuget.exe restore src/TgSharp.sln
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1
- name: Build & Upload Package
run: |
$date = get-date -format "yyyyMMdd-HHmm"
$hash = & git rev-parse --short HEAD
./Nuget.exe pack src/TgSharp.Core/TgSharp.Core.csproj -Version "0.0.1-date.$date.git.$hash" -Build -Properties Configuration=Release
If ($Env:GITHUB_REF -eq 'refs/heads/master' -AND '${{ secrets.NUGET_API_KEY }}' -ne '') {
./Nuget.exe push "TgSharp.0.0.1-date.$date.git.$hash.nupkg" ${{secrets.NUGET_API_KEY}} -Source https://api.nuget.org/v3/index.json
}

View file

@ -15,9 +15,9 @@ It's a perfect fit for any developer who would like to send data directly to Tel
<copyright>Copyright 2015-2020</copyright>
</metadata>
<files>
<file src="bin\Debug\BigMath.dll" target="lib\net45\BigMath.dll" />
<file src="bin\Debug\Ionic.ZLib.dll" target="lib\net45\Ionic.ZLib.dll" />
<file src="bin\Debug\TeleSharp.TL.dll" target="lib\net45\TeleSharp.TL.dll" />
<file src="bin\Debug\TgSharp.Core.dll" target="lib\net45\TgSharp.Core.dll" />
<file src="bin\Release\BigMath.dll" target="lib\net45\BigMath.dll" />
<file src="bin\Release\Ionic.ZLib.dll" target="lib\net45\Ionic.ZLib.dll" />
<file src="bin\Release\TeleSharp.TL.dll" target="lib\net45\TeleSharp.TL.dll" />
<file src="bin\Release\TgSharp.Core.dll" target="lib\net45\TgSharp.Core.dll" />
</files>
</package>