-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
59 lines (48 loc) · 1.55 KB
/
build.ps1
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
# Pour construire l'exécutable de mise à jour .\build.ps1 u
$IsUp = $args[0]
if ($IsUp) {
ps2exe `
-inputFile .\scripts\update.ps1 `
-outputFile .\MonDrive-Update.exe `
-iconFile .\src\assets\update.ico `
-title 'MonDrive - Update' `
-product 'MonDrive - Update' `
-copyright 'GPL-3.0 License' `
-version "1.0.0"
Exit
}
ps2exe `
-inputFile .\scripts\server.ps1 `
-outputFile .\MonDrive.exe `
-iconFile .\public\favicon.ico `
-title 'MonDrive' `
-product 'MonDrive' `
-copyright 'GPL-3.0 License' `
-version "1.0.0"
$FolderDist = ".\MonDrive"
$Version = $(Get-Content .\VERSION)
$File = "MonDrive.zip"
yarn build
Rename-Item .\dist $FolderDist
Remove-Item $FolderDist\data.json
Copy-Item .\scripts\app.ps1 $FolderDist
Copy-Item .\VERSION $FolderDist
Copy-Item .\cmdssh.txt $FolderDist
Copy-Item .\exe\* $FolderDist
Compress-Archive $FolderDist $File
function PushGitHub {
$filelog = ".\CHANGELOG.md"
$lines = Get-Content $filelog
$rem = @()
@("---") | ForEach-Object {
$rem += $lines[(($lines | Select-String -Pattern "$_").LineNumber)..`
(($lines | Select-String -Pattern "$_").LineNumber + 1000)]
}
(Compare-Object $lines $rem | Select-Object -ExpandProperty InputObject) `
-Replace '---' | Where-Object { $_ -ne "" } | Set-Content .\.GITLOG.md
gh release create v$Version --title "Release v$Version" --notes-file .\.GITLOG.md $File
Remove-Item .\.GITLOG.md
}
PushGitHub
Remove-Item -Recurse $FolderDist
Remove-Item *.zip