-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (112 loc) · 3.57 KB
/
release.yml
File metadata and controls
132 lines (112 loc) · 3.57 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Create Release
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
outputs:
artifact_name: ${{ steps.artifact.outputs.name }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -e .
- name: Build executable
run: |
pyinstaller build/gui.spec --clean --noconfirm
- name: Display build info
shell: pwsh
run: |
Write-Host "Build Information"
Write-Host "=================="
$exePath = "dist\wareflowx.exe"
if (Test-Path $exePath) {
$fileInfo = Get-Item $exePath
Write-Host "File: $($fileInfo.Name)"
Write-Host "Size: $([math]::Round($fileInfo.Length / 1MB, 2)) MB"
Write-Host "Created: $($fileInfo.LastWriteTime)"
}
- name: Verify executable
shell: pwsh
run: |
$exePath = "dist\wareflowx.exe"
if (-not (Test-Path $exePath)) {
Write-Host "ERROR: Executable was not built!"
exit 1
}
$fileSize = (Get-Item $exePath).Length
if ($fileSize -lt 10MB) {
Write-Host "WARNING: Executable size is unusually small: $fileSize bytes"
}
- name: Generate SHA256 checksum
shell: pwsh
run: |
$exePath = "dist\wareflowx.exe"
$hash = Get-FileHash -Path $exePath -Algorithm SHA256
$checksumPath = "dist\wareflowx.exe.sha256"
$hash.Hash | Out-File -FilePath $checksumPath -Encoding utf8
Write-Host "Checksum: $($hash.Hash)"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: wareflow-gui-windows
path: |
dist/wareflowx.exe
dist/wareflowx.exe.sha256
retention-days: 90
- name: Set artifact name
id: artifact
run: echo "name=wareflow-gui-windows" >> $env:GITHUB_OUTPUT
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact_name }}
path: ./artifacts
- name: Display artifacts
run: |
echo "Downloaded artifacts:"
ls -lh artifacts/
- name: Verify artifacts
run: |
if [ ! -f "artifacts/wareflowx.exe" ]; then
echo "ERROR: wareflowx.exe not found!"
exit 1
fi
if [ ! -f "artifacts/wareflowx.exe.sha256" ]; then
echo "ERROR: Checksum file not found!"
exit 1
fi
echo "All artifacts verified successfully"
- name: Extract version from tag
id: version
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
artifacts/wareflowx.exe
artifacts/wareflowx.exe.sha256
draft: false
prerelease: false
generate_release_notes: true
name: Wareflow Analysis v${{ steps.version.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}