-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (31 loc) · 1.48 KB
/
testpack.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Build, test and package
on: push
jobs:
package:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Test
run: dotnet test --nologo
- name: Package
run: |
dotnet publish BadMedicine/BadMedicine.csproj -o linux-x64 -r linux-x64 -c Release --self-contained --nologo -p:PublishSingleFile=true -p:GenerateDocumentationFile=false
dotnet publish BadMedicine/BadMedicine.csproj -o win-x64 -r win-x64 -c Release --self-contained --nologo -p:PublishSingleFile=true -p:GenerateDocumentationFile=false
dotnet pack BadMedicine.Core/BadMedicine.Core.csproj -p:PackageVersion=$(fgrep AssemblyInformationalVersion SharedAssemblyInfo.cs|cut -d'"' -f2) -o . --include-source --include-symbols --nologo -c Release
tar czf badmedicine-cli-linux-x64.tgz ./linux-x64
zip -9rj badmedicine-cli-win-x64.zip win-x64
- name: Nuget push
if: contains(github.ref,'refs/tags/')
run: nuget push HIC.*.nupkg -skipDuplicate -Source https://api.nuget.org/v3/index.json -ApiKey ${{ secrets.NUGET_KEY }}
- name: Upload release binaries
uses: svenstaro/upload-release-action@2.7.0
if: contains(github.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: badmedicine-cli-*
tag: ${{ github.ref }}
overwrite: true
file_glob: true