forked from mkaring/ConfuserEx
-
Notifications
You must be signed in to change notification settings - Fork 4
103 lines (90 loc) · 3.63 KB
/
Copy pathci.yml
File metadata and controls
103 lines (90 loc) · 3.63 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: ci
# Build validation. GitHub Actions minutes are limited, so this runs automatically
# only for PRs into `main` (the develop -> main gate). For PRs into `develop`,
# day-to-day validation is done with scripts/local-ci.sh; a run here happens only
# when an admin adds the `run-ci` label (re-add it to trigger each run) or
# dispatches the workflow manually. See the `if:` on the build job below.
#
# This workflow does NOT publish releases — that is handled by release.yml
# (manual dispatch + a monthly check for new commits on main).
on:
pull_request:
branches: [main, develop]
types: [opened, synchronize, reopened, labeled]
paths-ignore: ['**.md', 'docs/**', 'LICENSE*']
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
# Auto for PRs into main and manual dispatch; for develop PRs only when an
# admin adds the `run-ci` label.
if: >-
github.event_name == 'workflow_dispatch' ||
github.base_ref == 'main' ||
(github.event.action == 'labeled' && github.event.label.name == 'run-ci')
runs-on: windows-2025
timeout-minutes: 10
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Cache NuGet packages
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.vcxproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Install nbgv
run: dotnet tool install -g nbgv
- name: Compute version
id: version
shell: pwsh
run: |
$ver = nbgv get-version -v NuGetPackageVersion
echo "VERSION=$ver" >> $env:GITHUB_OUTPUT
Write-Host "Version: $ver"
- name: Restore
run: msbuild Confuser2.sln -t:Restore -verbosity:minimal
- name: Build
run: msbuild Confuser2.sln -p:Configuration=Release -verbosity:minimal
- name: Package CLI
shell: pwsh
run: |
$src = 'Confuser.CLI/bin/Release/net10.0'
$zip = 'ConfuserEx-CLI.zip'
Get-ChildItem $src -Exclude '*.pdb','*.xml' | Compress-Archive -DestinationPath $zip
Write-Host "Created $zip ($([math]::Round((Get-Item $zip).Length / 1MB, 1)) MB)"
- name: Package GUI
shell: pwsh
run: |
$src = 'ConfuserEx/bin/Release/net10.0-windows'
$zip = 'ConfuserEx-GUI.zip'
Get-ChildItem $src -Exclude '*.pdb','*.xml' | Compress-Archive -DestinationPath $zip
Write-Host "Created $zip ($([math]::Round((Get-Item $zip).Length / 1MB, 1)) MB)"
- name: Package combined
shell: pwsh
run: |
$zip = 'ConfuserEx.zip'
$tmp = 'combined'
New-Item -ItemType Directory -Path $tmp -Force | Out-Null
Copy-Item 'Confuser.CLI/bin/Release/net10.0/*' $tmp -Exclude '*.pdb','*.xml' -Recurse
Copy-Item 'ConfuserEx/bin/Release/net10.0-windows/*' $tmp -Exclude '*.pdb','*.xml' -Recurse -Force
Get-ChildItem $tmp | Compress-Archive -DestinationPath $zip
Remove-Item $tmp -Recurse -Force
Write-Host "Created $zip ($([math]::Round((Get-Item $zip).Length / 1MB, 1)) MB)"
- name: Upload packages
uses: actions/upload-artifact@v5
with:
name: confuserex-packages
path: |
ConfuserEx-CLI.zip
ConfuserEx-GUI.zip
ConfuserEx.zip
Confuser.MSBuild.Tasks/bin/Release/*.nupkg