Skip to content

Commit 80cdb90

Browse files
feat: Replace scripts by Nuke to build artifacts
1 parent fdff728 commit 80cdb90

15 files changed

Lines changed: 693 additions & 686 deletions

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ WindowSwitcherWinSetup/.vs/WindowSwitcherWinSetup/v17/.suo
3232
.vs/ProjectEvaluation/window-switcher.projects.v9.bin
3333
.vs/ProjectEvaluation/window-switcher.metadata.v9.bin
3434
/artifacts
35-
/scripts/artifacts
35+
/build/artifacts
36+
.nuke/temp/
3637
*.user

.nuke/build.schema.json

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"definitions": {
4+
"Host": {
5+
"type": "string",
6+
"enum": [
7+
"AppVeyor",
8+
"AzurePipelines",
9+
"Bamboo",
10+
"Bitbucket",
11+
"Bitrise",
12+
"GitHubActions",
13+
"GitLab",
14+
"Jenkins",
15+
"Rider",
16+
"SpaceAutomation",
17+
"TeamCity",
18+
"Terminal",
19+
"TravisCI",
20+
"VisualStudio",
21+
"VSCode"
22+
]
23+
},
24+
"ExecutableTarget": {
25+
"type": "string",
26+
"enum": [
27+
"AppImage",
28+
"Artifacts",
29+
"Compile",
30+
"Installer",
31+
"LinuxArtifacts",
32+
"PublishLinux",
33+
"PublishWindows",
34+
"Restore",
35+
"ValidateParameters",
36+
"WindowsArtifacts"
37+
]
38+
},
39+
"Verbosity": {
40+
"type": "string",
41+
"description": "",
42+
"enum": [
43+
"Verbose",
44+
"Normal",
45+
"Minimal",
46+
"Quiet"
47+
]
48+
},
49+
"NukeBuild": {
50+
"properties": {
51+
"Continue": {
52+
"type": "boolean",
53+
"description": "Indicates to continue a previously failed build attempt"
54+
},
55+
"Help": {
56+
"type": "boolean",
57+
"description": "Shows the help text for this build assembly"
58+
},
59+
"Host": {
60+
"description": "Host for execution. Default is 'automatic'",
61+
"$ref": "#/definitions/Host"
62+
},
63+
"NoLogo": {
64+
"type": "boolean",
65+
"description": "Disables displaying the NUKE logo"
66+
},
67+
"Partition": {
68+
"type": "string",
69+
"description": "Partition to use on CI"
70+
},
71+
"Plan": {
72+
"type": "boolean",
73+
"description": "Shows the execution plan (HTML)"
74+
},
75+
"Profile": {
76+
"type": "array",
77+
"description": "Defines the profiles to load",
78+
"items": {
79+
"type": "string"
80+
}
81+
},
82+
"Root": {
83+
"type": "string",
84+
"description": "Root directory during build execution"
85+
},
86+
"Skip": {
87+
"type": "array",
88+
"description": "List of targets to be skipped. Empty list skips all dependencies",
89+
"items": {
90+
"$ref": "#/definitions/ExecutableTarget"
91+
}
92+
},
93+
"Target": {
94+
"type": "array",
95+
"description": "List of targets to be invoked. Default is '{default_target}'",
96+
"items": {
97+
"$ref": "#/definitions/ExecutableTarget"
98+
}
99+
},
100+
"Verbosity": {
101+
"description": "Logging verbosity during build execution. Default is 'Normal'",
102+
"$ref": "#/definitions/Verbosity"
103+
}
104+
}
105+
}
106+
},
107+
"allOf": [
108+
{
109+
"properties": {
110+
"AppImageOutDir": {
111+
"type": "string"
112+
},
113+
"AppImageToolPath": {
114+
"type": "string"
115+
},
116+
"Configuration": {
117+
"type": "string"
118+
},
119+
"InstallerOutDir": {
120+
"type": "string"
121+
},
122+
"LinuxPublishDir": {
123+
"type": "string"
124+
},
125+
"LinuxRuntime": {
126+
"type": "string"
127+
},
128+
"MakensisPath": {
129+
"type": "string"
130+
},
131+
"SelfContained": {
132+
"type": "boolean"
133+
},
134+
"Version": {
135+
"type": "string"
136+
},
137+
"WindowsPublishDir": {
138+
"type": "string"
139+
},
140+
"WindowsRuntime": {
141+
"type": "string"
142+
}
143+
}
144+
},
145+
{
146+
"$ref": "#/definitions/NukeBuild"
147+
}
148+
]
149+
}

.nuke/parameters.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"$schema": "./build.schema.json"
3+
}

README.md

Lines changed: 34 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -138,72 +138,69 @@ Download the latest release [here](https://github.com/SebastienDuruz/Window-Swit
138138

139139
From the repo root:
140140

141-
- Build: `dotnet build Window-Switcher.sln`
141+
- Build: `dotnet build Window-Switcher.slnx`
142142
- Run: `dotnet run --project src/WindowSwitcher/WindowSwitcher.csproj`
143143
- Test: `dotnet test src/WindowSwitcher.Tests/WindowSwitcher.Tests.csproj`
144144

145145
The application version is centralized in `./Directory.Build.props` via `WindowSwitcherVersion`.
146146

147-
Build resources used by the packaging scripts now live under:
147+
Build resources used by packaging now live under:
148148

149-
- `./scripts/assets/installer/`
150-
- `./scripts/assets/packaging/linux/`
149+
- `./build/assets/installer/`
150+
- `./build/assets/packaging/linux/`
151151

152152
Generated build outputs now live under:
153153

154-
- `./scripts/artifacts/`
154+
- `./build/artifacts/`
155155

156-
## Build Windows installer (scripted)
156+
## Build Artifacts With Nuke
157157

158-
Prerequisite: install NSIS (so `makensis` is available).
158+
Nuke is now the only build/deploy entrypoint for installer/AppImage packaging.
159159

160160
From the repo root:
161161

162-
`pwsh ./scripts/build-installer.ps1`
162+
- Linux/macOS shell: `./build/build.sh --target <TargetName>`
163+
- Windows cmd: `./build/build.cmd --target <TargetName>`
164+
- Windows PowerShell: `./build/build.cmd --target <TargetName>`
163165

164-
The NSIS definition used by these scripts is stored in `./scripts/assets/installer/WindowSwitcher.nsi`.
166+
From `./build/` you can also run:
165167

166-
The script reads the version from `./Directory.Build.props` by default. Use `-Version` only to override it for a specific build.
168+
- Linux/macOS shell: `./build.sh --target <TargetName>`
169+
- Windows cmd: `build.cmd --target <TargetName>`
170+
- Windows PowerShell: `./build.cmd --target <TargetName>`
167171

168-
(Works in Windows PowerShell too: `powershell ./scripts/build-installer.ps1`.)
172+
Available targets:
169173

170-
From Linux/macOS, you can also use:
174+
- `Restore`
175+
- `Compile`
176+
- `Installer` (Windows host only)
177+
- `AppImage` (Linux host only)
178+
- `Artifacts` (builds the artifact for the current host OS)
171179

172-
`./scripts/build-installer.sh`
180+
Examples:
173181

174-
## Build Linux AppImage (scripted)
182+
- Windows installer (on Windows): `./build/build.cmd --target Installer`
183+
- Linux AppImage (on Linux): `./build/build.sh --target AppImage`
175184

176-
From the repo root:
177-
178-
`./scripts/build-appimage.sh`
179-
180-
The AppImage packaging resources used by this script are stored in `./scripts/assets/packaging/linux/`.
181-
182-
The script reads the version from `./Directory.Build.props` by default. Use `-v` only to override it for a specific build.
183-
184-
Output: `./scripts/artifacts/appimage/WindowSwitcher-<version>-linux-x64.AppImage`
185-
186-
## Build all artifacts from Linux
187-
188-
From the repo root:
185+
Outputs:
189186

190-
`./scripts/build-artifacts.sh`
187+
- `./build/artifacts/installer/WindowSwitcher-setup-<version>-<win-runtime>.exe`
188+
- `./build/artifacts/appimage/WindowSwitcher-<version>-<linux-runtime>.AppImage`
191189

192-
By default, this produces both:
190+
Versioning:
193191

194-
- `./scripts/artifacts/installer/WindowSwitcher-setup-<version>-win-x64.exe`
195-
- `./scripts/artifacts/appimage/WindowSwitcher-<version>-linux-x64.AppImage`
192+
- Version is read from `./Directory.Build.props` (`WindowSwitcherVersion`) by default.
193+
- Override for one build with `--version <x.y.z>`.
196194

197-
You can also target a single artifact from the wrapper:
195+
Important:
198196

199-
- `./scripts/build-artifacts.sh --skip-installer` builds only the Linux AppImage
200-
- `./scripts/build-artifacts.sh --skip-appimage` builds only the Windows installer
197+
- Cross-OS packaging is intentionally disabled.
198+
- `appimagetool` is auto-downloaded to `./build/artifacts/tools/` when missing.
201199

202-
Prerequisites on Linux:
200+
Prerequisites:
203201

204202
- `.NET SDK`
205-
- `NSIS` (`makensis`) when building the Windows installer
206-
- `appimagetool` in `PATH`, or let the AppImage script download it automatically
203+
- `NSIS` (`makensis`) for `Installer`
207204

208205
### Linux dependencies
209206

0 commit comments

Comments
 (0)