-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 2.87 KB
/
dotnet-core.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
55
name: Build, test and package
on: push
env:
MSSQL_SA_PASSWORD: "YourStrong!Passw0rd"
ACCEPT_EULA: "Y"
MSSQL_PID: "developer"
DOTNET_NOLOGO: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
jobs:
package:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.200
- name: Get version
id: version
shell: cmd
run: |
for /f tokens^=1^,2^ delims^=^" %%i in (SharedAssemblyInfo.cs) do @if "%%i"=="[assembly: AssemblyVersion(" echo ::set-output name=version::%%j
for /f tokens^=2^,4^ delims^=^" %%i in (AutomationPlugins/LoadModules.Extensions.AutomationPlugins/LoadModules.Extensions.AutomationPlugins.csproj) do @if "%%i"=="HIC.RDMP.Plugin" echo ::set-output name=rdmpversion::%%j
- name: Set up database
run: |
Invoke-WebRequest -Uri https://github.com/HicServices/RDMP/releases/download/v${{ steps.version.outputs.rdmpversion }}/rdmp-${{ steps.version.outputs.rdmpversion }}-cli-win-x64.zip -OutFile rdmp.zip
Expand-Archive -Path rdmp.zip -DestinationPath .\rdmpcli
cmd.exe /c rdmpcli\rdmp.exe install --createdatabasetimeout 180 localhost TEST_ -d
- name: Test
run: |
dotnet test -c Release
- name: Build
run: |
cd Plugin/windows
dotnet publish --runtime win-x64 -c Release --self-contained false
cd ../main
dotnet publish -c Release --self-contained false
cd ../..
cmd /c nuget.exe pack ./HIC.Extensions.nuspec -Properties Configuration=Release -IncludeReferencedProjects -Symbols -Version ${{ steps.version.outputs.version }}
cmd /c rdmpcli\rdmp.exe pack --file HIC.Rdmp.Extensions.Plugin.${{ steps.version.outputs.version }}.nupkg --CatalogueConnectionString "Data Source=localhost;Database=TEST_Catalogue;Integrated Security=sspi;Encrypt=true;TrustServerCertificate=true" --DataExportConnectionString "Data Source=localhost;Database=TEST_DataExport;Integrated Security=sspi;Encrypt=true;TrustServerCertificate=true"
cmd /c rdmpcli\rdmp.exe cmd listsupportedcommands --CatalogueConnectionString "Data Source=localhost;Database=TEST_Catalogue;Integrated Security=sspi;Encrypt=true;TrustServerCertificate=true" --DataExportConnectionString "Data Source=localhost;Database=TEST_DataExport;Integrated Security=sspi;Encrypt=true;TrustServerCertificate=true"
- name: Store created nupkg files
uses: actions/upload-artifact@v3
with:
path: ./*.nupkg
retention-days: 1
- name: Upload release binaries
if: contains(github.ref,'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: Rdmp.Extensions.Plugin.${{ steps.version.outputs.version }}.nupkg