-
Notifications
You must be signed in to change notification settings - Fork 5
54 lines (52 loc) · 2.5 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build, test and package
on: push
jobs:
package:
runs-on: ubuntu-20.04
steps:
- name: Disable disk flush
run: sudo apt-get install -y libeatmydata1
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
- name: Start MySQL for testing
run: sudo systemctl start mysql.service
- name: Test
run: |
dotnet test "./BadMedicine.Dicom.Tests/BadMedicine.Dicom.Tests.csproj" --nologo -c Release
curl -sL https://raw.githubusercontent.com/SMI/DicomTypeTranslation/master/Templates/CT.it > ./CT.it
cp BadDicom/BadDicom.template.yaml BadDicom.yaml
dotnet run --project BadDicom/BadDicom.csproj -- ./ 50000 10 CT
sed -i "s/Batches: 1/Batches: 5/g" ./BadDicom.yaml
sed -i "s/DropTables: false/DropTables: true/g" ./BadDicom.yaml
dotnet run --project BadDicom/BadDicom.csproj -- ./ 50000 10 CT
- name: Package
run: |
mkdir -p dist
dotnet pack ./BadMedicine.Dicom/BadMedicine.Dicom.csproj -c Release -p:DebugType=full -p:SymbolPackageFormat=snupkg -p:IncludeSymbols=true -p:Version=$(grep AssemblyInformationalVersion SharedAssemblyInfo.cs | cut -d'"' -f2) -nologo
for platform in linux-x64 win-x64 osx-{arm64,x64}
do
dotnet publish BadDicom/BadDicom.csproj -c Release -r $platform -o $platform --self-contained true -nologo -v q -p:PublishSingleFile=true -p:DebugType=embedded -p:GenerateDocumentationFile=false
done
zip -9r dist/baddicom-win-x64-v$(grep AssemblyInformationalVersion SharedAssemblyInfo.cs | cut -d'"' -f2).zip ./win-x64
for platform in linux-x64 win-x64 osx-{arm64,x64}
do
tar cJf dist/baddicom-${platform}-v$(grep AssemblyInformationalVersion SharedAssemblyInfo.cs | cut -d'"' -f2).tar.xz ./$platform
done
ls -lh dist
- name: Nuget push
if: contains(github.ref,'refs/tags/')
run: |
dotnet nuget push ./BadMedicine.Dicom/bin/Release/HIC.BadMedicine.Dicom.*.nupkg -k ${{ secrets.NUGET_KEY }} --skip-duplicate -s https://api.nuget.org/v3/index.json
- name: Upload release binaries
uses: svenstaro/[email protected]
if: contains(github.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/baddicom*
tag: ${{ github.ref }}
overwrite: true
file_glob: true