-
Notifications
You must be signed in to change notification settings - Fork 28
102 lines (87 loc) · 3.18 KB
/
release_windows.yml
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
name: Build Windows
on:
workflow_call:
inputs:
binary_list:
required: true
type: string
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Extract version from tag
id: get_version
run: |
$VERSION = $env:GITHUB_REF -replace 'refs/tags/', '' -replace '^v', ''
echo "VERSION=$VERSION" >> $env:GITHUB_OUTPUT
echo "Version extracted: $VERSION"
shell: pwsh
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build Mintlayer Node and GUI
run: cargo build --release
- name: Package Mintlayer Node
run: |
$VERSION = "${{ steps.get_version.outputs.VERSION }}"
$DEST = "Mintlayer_Node_win_${VERSION}"
New-Item -ItemType Directory -Path $DEST
$binary_list = "${{ inputs.binary_list }}" -split ',' | Where-Object { $_ -ne "node-gui" }
foreach ($binary in $binary_list) {
$binary = $binary.Trim()
if (Test-Path "target\release\$binary.exe") {
Copy-Item "target\release\$binary.exe" -Destination $DEST
} else {
Write-Warning "Binary not found: $binary.exe"
}
}
Compress-Archive -Path $DEST -DestinationPath "${DEST}.zip"
shell: pwsh
- name: Install NSIS
run: |
choco install nsis -y --force
echo "C:\Program Files (x86)\NSIS" >> $env:GITHUB_PATH
shell: pwsh
- name: Create License File
run: .\build-tools\win\create-license.ps1
shell: pwsh
- name: Create NSIS Installer Script
run: .\build-tools\win\create-nsis-script.ps1 -Version "${{ steps.get_version.outputs.VERSION }}"
shell: pwsh
- name: Build NSIS Installer
run: |
$makensisPath = (Get-Command makensis.exe).Source
Write-Host "Using makensis at: $makensisPath"
& $makensisPath installer.nsi
shell: pwsh
- name: Display NSIS Script
run: |
Get-Content -Path installer.nsi
shell: pwsh
- name: Package Mintlayer Node GUI
run: |
$VERSION = "${{ steps.get_version.outputs.VERSION }}"
$DEST = "Mintlayer_Node_GUI_win_${VERSION}"
New-Item -ItemType Directory -Path $DEST
Copy-Item "target\release\node-gui.exe" -Destination $DEST
Compress-Archive -Path $DEST -DestinationPath "${DEST}.zip"
shell: pwsh
- name: Upload Node ZIP Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }}
path: Mintlayer_Node_win_${{ steps.get_version.outputs.VERSION }}.zip
- name: Upload GUI ZIP Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}
path: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}.zip
- name: Upload NSIS Installer Artifact
uses: actions/upload-artifact@v4
with:
name: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}_Setup
path: Mintlayer_Node_GUI_win_${{ steps.get_version.outputs.VERSION }}_Setup.exe