-
-
Notifications
You must be signed in to change notification settings - Fork 14
52 lines (44 loc) · 1.37 KB
/
demos.yml
File metadata and controls
52 lines (44 loc) · 1.37 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
name: demos
on:
push:
branches: [ main, dev, 'dev/*', 'feature/*', 'rel/*' ]
paths-ignore:
- changelog.md
- readme.md
pull_request:
types: [opened, synchronize, reopened]
env:
DOTNET_NOLOGO: true
PackOnBuild: true
GeneratePackageOnBuild: true
VersionPrefix: 42.42.${{ github.run_number }}
VersionLabel: ${{ github.ref }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
MSBUILDTERMINALLOGGER: auto
defaults:
run:
shell: pwsh
jobs:
demos:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
- name: ⚙ dotnet
uses: devlooped/actions-dotnet-env@v1
- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog
- name: 🚀 demo
run: |
# detect and set the version of the SDK we just built
$version = gci bin | select -first 1 -expandproperty BaseName | %{ $_.Substring(11) }
pushd src/Demo
jq --arg version "$version" '.["msbuild-sdks"].SmallSharp = $version' global.json > temp.json && mv temp.json global.json
# build with each top-level file as the active one
foreach ($file in gci *.cs) {
dotnet build -p:ActiveFile=$($file.Name)
if ($LASTEXITCODE -ne 0) {
Write-Error "Build failed for $($file.Name)"
exit $LASTEXITCODE
}
}