-
Notifications
You must be signed in to change notification settings - Fork 8
84 lines (65 loc) · 2.33 KB
/
Copy pathbuild.yml
File metadata and controls
84 lines (65 loc) · 2.33 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Build
on:
push:
pull_request:
env:
CONFIGURATION: Release
MAIN_PROJECT: component
TARGET_FRAMEWORK: net8.0
ONESCRIPT_URL: https://oscript.io/downloads/2_0_1/fdd/x64
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup locale
shell: pwsh
run: chcp 65001
- name: Install OneScript
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path engine | Out-Null
Push-Location engine
Invoke-WebRequest -Uri $env:ONESCRIPT_URL -OutFile fdd.zip
7z x fdd.zip | Out-Null
"$PWD\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Pop-Location
oscript -version
opm install opm
- name: Restore
run: dotnet restore oscript-component.sln
- name: Build
run: dotnet build oscript-component.sln --configuration %CONFIGURATION% --no-restore
- name: Test NUnit
run: dotnet test NUnitTests/NUnitTests.csproj --configuration %CONFIGURATION% --no-build --verbosity normal
- name: Test OneScript
run: oscript testcomponent.os
- name: Publish component
run: dotnet publish ${{ env.MAIN_PROJECT }}/${{ env.MAIN_PROJECT }}.csproj --configuration %CONFIGURATION% --no-build
- name: Build package
shell: pwsh
run: |
$publish = "$env:MAIN_PROJECT/bin/$env:CONFIGURATION/$env:TARGET_FRAMEWORK/publish"
Remove-Item "$publish/*.pdb" -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path oslib/Components/dotnet | Out-Null
Remove-Item `
"$publish/ScriptEngine*.*", `
"$publish/NewtonSoft*.*", `
"$publish/DotNetZip*.*", `
"$publish/OneScript*.*" `
-ErrorAction SilentlyContinue
Copy-Item "$publish/*" -Destination oslib/Components/dotnet/ -Recurse -Force
Push-Location oslib
opm build .
Get-ChildItem *.ospx | ForEach-Object { opm install -f $_.Name }
Pop-Location
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: component
path: oslib/*.ospx