-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (89 loc) · 3.03 KB
/
Copy pathbuild.yml
File metadata and controls
107 lines (89 loc) · 3.03 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
name: Build & release
# Only runs when a version tag is pushed (e.g. v0.1.0) or triggered manually -
# NOT on every push/PR. Day-to-day rounds are branch -> PR -> merge with no CI;
# this workflow is reserved for cutting an actual release.
on:
push:
tags: ["v*.*.*"]
workflow_dispatch:
permissions:
contents: write
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Cache CMake FetchContent dependencies
uses: actions/cache@v4
with:
path: build/_deps
key: win-deps-${{ hashFiles('CMakeLists.txt') }}
- name: Configure
run: cmake -B build -A x64
- name: Build (Release)
run: cmake --build build --target neo-processing -j --config Release
- name: Locate Release output
id: locate
shell: bash
run: |
if [ -f "build/Release/neo-processing.exe" ]; then
echo "dir=build/Release" >> "$GITHUB_OUTPUT"
else
echo "dir=build" >> "$GITHUB_OUTPUT"
fi
- name: Package
shell: bash
run: |
mkdir -p dist
cd "${{ steps.locate.outputs.dir }}"
7z a -tzip "$GITHUB_WORKSPACE/dist/neo-processing-windows.zip" .
- name: Upload distributable
uses: actions/upload-artifact@v4
with:
name: neo-processing-windows
path: dist/neo-processing-windows.zip
if-no-files-found: error
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake git libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Cache CMake FetchContent dependencies
uses: actions/cache@v4
with:
path: build/_deps
key: linux-deps-${{ hashFiles('CMakeLists.txt') }}
- name: Configure
run: cmake -B build
- name: Build (Release)
run: cmake --build build --target neo-processing -j --config Release
- name: Package
run: |
mkdir -p dist/neo-processing/icons
cp build/neo-processing dist/neo-processing/
cp icons/app_icon.ico icons/app_icon_small.ico dist/neo-processing/icons/
tar -C dist -czf dist/neo-processing-linux.tar.gz neo-processing
- name: Upload distributable
uses: actions/upload-artifact@v4
with:
name: neo-processing-linux
path: dist/neo-processing-linux.tar.gz
if-no-files-found: error
release:
needs: [windows, linux]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
path: artifacts
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
files: |
artifacts/neo-processing-windows/neo-processing-windows.zip
artifacts/neo-processing-linux/neo-processing-linux.tar.gz
generate_release_notes: true