forked from FastFlowLM/FastFlowLM
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 2.42 KB
/
Copy pathwindows-build.yml
File metadata and controls
98 lines (81 loc) · 2.42 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
name: Build Windows Package
on:
push:
branches:
- main
- windows_zip_workflow
tags:
- '*'
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-windows:
runs-on: [self-hosted, windows, x64]
defaults:
run:
working-directory: src
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Configure CMake
shell: powershell
run: |
cmake --preset windows-default
- name: Build
shell: powershell
run: |
cmake --build --preset windows-default --config Release --parallel
- name: Prepare package files
shell: powershell
run: |
$ErrorActionPreference = "Stop"
$dist = "dist"
if (Test-Path $dist) {
Remove-Item $dist -Recurse -Force
}
New-Item -ItemType Directory -Force $dist | Out-Null
# Main executable
Copy-Item -Path .\build\flm.exe -Destination $dist\ -Force
# Required data assets
Copy-Item -Path .\xclbins -Destination $dist\ -Recurse -Force
Copy-Item -Path .\model_list.json -Destination $dist\ -Force
Copy-Item -Path .\lib\*.dll -Destination $dist\ -Force
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: fastflowlm-windows-${{ github.sha }}
path: src/dist/
if-no-files-found: error
release:
runs-on: ubuntu-latest
needs: build-windows
if: github.ref_type == 'tag'
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
path: release-assets
- name: Create release zip
run: |
set -euo pipefail
version="${GITHUB_REF_NAME#v}"
zip_name="fastflowlm_${version}_windows_amd64.zip"
# Zip the downloaded artifact payload once for the GitHub Release asset.
cd release-assets
zip -r "../${zip_name}" .
- name: Upload zip to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
files: fastflowlm_*.zip
overwrite_files: true
fail_on_unmatched_files: true