File tree Expand file tree Collapse file tree 4 files changed +42
-49
lines changed Expand file tree Collapse file tree 4 files changed +42
-49
lines changed Original file line number Diff line number Diff line change @@ -240,16 +240,6 @@ jobs:
240
240
# automatically do it on Windows
241
241
pdm run bash -c "scripts/build-os-packages/build-os-packages $args"
242
242
243
- - name : Build Chocolatey package & test it
244
- # About test part, cf https://docs.chocolatey.org/en-us/create/create-packages/#testing-your-package
245
- if : startsWith(matrix.os, 'windows-')
246
- shell : bash
247
- run : |
248
- windows_zip=$(find packages -maxdepth 1 -type f -name "*.zip" | grep "windows" | head -n 1)
249
- scripts/chocolatey/pack $windows_zip packages
250
- cd packages
251
- choco install ggshield --debug --verbose --source . --noop
252
-
253
243
- name : Override base Docker image used for functional tests on Windows
254
244
if : matrix.os == 'windows-2022'
255
245
# This is required because GitHub Windows runner is not configured to
Original file line number Diff line number Diff line change @@ -320,11 +320,8 @@ step_create_archive() {
320
320
info " Archive created in $pkg_path & $archive_path "
321
321
;;
322
322
Windows)
323
- archive_path=" $PACKAGES_DIR /$ARCHIVE_DIR_NAME .zip"
324
- pushd " $PACKAGES_DIR "
325
- 7z a " $archive_path " " $ARCHIVE_DIR_NAME "
326
- popd
327
- info " Archive created in $archive_path "
323
+ create_windows_packages
324
+ test_chocolatey_package
328
325
;;
329
326
esac
330
327
}
Original file line number Diff line number Diff line change @@ -26,3 +26,43 @@ windows_sign() {
26
26
--input " $archive_dir /$INSTALL_PREFIX /ggshield.exe"
27
27
}
28
28
29
+ windows_create_archive () {
30
+ local archive_path=" $PACKAGES_DIR /$ARCHIVE_DIR_NAME .zip"
31
+ pushd " $PACKAGES_DIR "
32
+ 7z a " $archive_path " " $ARCHIVE_DIR_NAME "
33
+ popd
34
+ # info "Archive created in $archive_path"
35
+ }
36
+
37
+ windows_build_chocolatey_package () {
38
+ # choco-package will contain everything needed to build the nupkg
39
+ # we delete it a the end.
40
+ mkdir choco-package
41
+ mkdir choco-package/tools
42
+
43
+ cp -r " $PACKAGES_DIR /$ARCHIVE_DIR_NAME /_internal" choco-package/tools
44
+ cp " $PACKAGES_DIR /$ARCHIVE_DIR_NAME /ggshield.exe" choco-package/tools
45
+ cp " $ROOT_DIR /scripts/chocolatey/ggshield.nuspec" choco-package
46
+ cp " $ROOT_DIR /scripts/chocolatey/VERIFICATION.txt" choco-package/tools
47
+ cp " $ROOT_DIR /LICENSE" choco-package/tools/LICENSE.txt
48
+ sed -i " s/__VERSION__/$VERSION /" choco-package/ggshield.nuspec
49
+
50
+ choco pack choco-package/* --version $VERSION --outdir $PACKAGES_DIR
51
+
52
+ # info "Chocolatey package created in $PACKAGES_DIR/ggshield.$VERSION.nupkg"
53
+
54
+ rm -rf choco-package
55
+
56
+ }
57
+
58
+ # cf https://docs.chocolatey.org/en-us/create/create-packages/#testing-your-package
59
+ test_chocolatey_package () {
60
+ pushd " $PACKAGES_DIR "
61
+ choco install ggshield --debug --verbose --source . --noop
62
+ popd
63
+ }
64
+
65
+ create_windows_packages () {
66
+ windows_create_archive
67
+ windows_build_chocolatey_package
68
+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments