Skip to content

Commit 4aa8111

Browse files
committed
Action to add artifacts on release
1 parent e23f499 commit 4aa8111

File tree

3 files changed

+96
-3
lines changed

3 files changed

+96
-3
lines changed

.github/workflows/buildandtest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
- '.github/workflows/*.yml'
1212

1313
jobs:
14-
build:
14+
buildandtest:
1515

1616
runs-on: 'ubuntu-latest'
1717

@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
dotnet nuget add source -n ThermoPKG `pwd`/ThermoPKG/Libs/NetCore/Net8
4040
41-
- name: Buld and test
41+
- name: Build and test
4242
run: |
4343
cd main
4444
dotnet build .

.github/workflows/release.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types: 'published'
6+
7+
jobs:
8+
publish:
9+
10+
runs-on: 'ubuntu-latest'
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
path: 'main'
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: 8.0.x
21+
22+
- name: Get Thermo packages
23+
uses: actions/checkout@v4
24+
with:
25+
repository: 'thermofisherlsms/RawFileReader'
26+
path: 'ThermoPKG'
27+
token: ${{ secrets.GITHUB_TOKEN }}
28+
sparse-checkout: 'Libs/NetCore/Net8/*.nupkg'
29+
sparse-checkout-cone-mode: 'false'
30+
31+
- name: Add Thermo packages as NuGet source
32+
run: |
33+
dotnet nuget add source -n ThermoPKG `pwd`/ThermoPKG/Libs/NetCore/Net8
34+
35+
- name: Publish all
36+
run: |
37+
dotnet publish --configuration Release --runtime linux-x64 main/ThermoRawFileParser.csproj --sc -o publish/linux-x64
38+
dotnet publish --configuration Release --runtime win-x64 main/ThermoRawFileParser.csproj --sc -o publish/win-x64
39+
dotnet publish --configuration Release --runtime osx-x64 main/ThermoRawFileParser.csproj --sc -o publish/osx-x64
40+
dotnet publish --configuration Release --framework net8.0 main/ThermoRawFileParser.csproj -o publish/net8
41+
42+
- name: Zipping Linux standalone
43+
uses: vimtor/[email protected]
44+
with:
45+
files: publish/linux-x64
46+
dest: ThermoRawFileParser-${{ github.ref_name }}-linux.zip
47+
48+
- name: Upload Linux to release
49+
uses: svenstaro/upload-release-action@v2
50+
with:
51+
repo_token: ${{ secrets.GITHUB_TOKEN }}
52+
file: ThermoRawFileParser-${{ github.ref_name }}-linux.zip
53+
tag: ${{ github.ref }}
54+
55+
- name: Zipping OSX standalone
56+
uses: vimtor/[email protected]
57+
with:
58+
files: publish/osx-x64
59+
dest: ThermoRawFileParser-${{ github.ref_name }}-osx.zip
60+
61+
- name: Upload OSX to release
62+
uses: svenstaro/upload-release-action@v2
63+
with:
64+
repo_token: ${{ secrets.GITHUB_TOKEN }}
65+
file: ThermoRawFileParser-${{ github.ref_name }}-osx.zip
66+
tag: ${{ github.ref }}
67+
68+
- name: Zipping Windows standalone
69+
uses: vimtor/[email protected]
70+
with:
71+
files: publish/win-x64
72+
dest: ThermoRawFileParser-${{ github.ref_name }}-win.zip
73+
74+
- name: Upload Windows to release
75+
uses: svenstaro/upload-release-action@v2
76+
with:
77+
repo_token: ${{ secrets.GITHUB_TOKEN }}
78+
file: ThermoRawFileParser-${{ github.ref_name }}-win.zip
79+
tag: ${{ github.ref }}
80+
81+
- name: Zipping framework-based
82+
uses: vimtor/[email protected]
83+
with:
84+
files: publish/net8
85+
dest: ThermoRawFileParser-${{ github.ref_name }}-net8.zip
86+
87+
- name: Upload framework-based to release
88+
uses: svenstaro/upload-release-action@v2
89+
with:
90+
repo_token: ${{ secrets.GITHUB_TOKEN }}
91+
file: ThermoRawFileParser-${{ github.ref_name }}-net8.zip
92+
tag: ${{ github.ref }}
93+

ThermoRawFileParserTest/ThermoRawFileParserTest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>net8.0</TargetFramework>
66
<ImplicitUsings>disable</ImplicitUsings>
7-
<Nullable>enable</Nullable>
7+
<Nullable>annotations</Nullable>
88
<StartupObject></StartupObject>
99
<PlatformTarget>x64</PlatformTarget>
1010
<Platforms>x64</Platforms>

0 commit comments

Comments
 (0)