forked from RetroTournaments/Graphite
-
Notifications
You must be signed in to change notification settings - Fork 1
139 lines (113 loc) · 3.96 KB
/
build.yml
File metadata and controls
139 lines (113 loc) · 3.96 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
133
134
135
136
137
138
139
name: graphite-ci
on:
workflow_dispatch:
inputs:
name:
description: 'Release name like: v0.001'
required: true
type: string
jobs:
build_linux_x64:
runs-on: ubuntu-20.04
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Install dependencies
run: |
sudo apt-get update && \
sudo apt install build-essential cmake git ninja-build \
libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \
mesa-common-dev xorg-dev libopencv-dev libfuse2
- name: Prepare build directory
run: |
mkdir ${GITHUB_WORKSPACE}/build && \
cd ${GITHUB_WORKSPACE}/build && \
cmake -G Ninja ..
- name: build
run: |
cd ${GITHUB_WORKSPACE}/build && \
ninja
- name: Generate AppImage
run: |
cd ${GITHUB_WORKSPACE}/build && \
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-x86_64.AppImage && \
chmod +x linuxdeploy-x86_64.AppImage && \
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--executable ./graphite/graphite \
-d ../graphite.desktop \
-i ../graphite.svg \
--output appimage && \
mv ${GITHUB_WORKSPACE}/build/Graphite*-x86_64.AppImage ${GITHUB_WORKSPACE}/graphite-x86_64.AppImage
- name: Collect artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: graphite-linux-x86_64
path: graphite-x86_64.AppImage
build_window_x64:
runs-on: windows-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
with:
submodules: "recursive"
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
- name: install 7zip
run: |
choco install 7zip wget -y
- name: Install opencv
run: |
cd $env:GITHUB_WORKSPACE
wget https://github.com/opencv/opencv/releases/download/4.8.0/opencv-4.8.0-windows.exe
7z x opencv-4.8.0-windows.exe -o3rd
- name: Prepare build directory
run: |
mkdir $env:GITHUB_WORKSPACE/build
cd $env:GITHUB_WORKSPACE/build
cmake -D OpenCV_DIR="$env:GITHUB_WORKSPACE/3rd/opencv/build" -A x64 ..
- name: Build app for release
run: |
cd $env:GITHUB_WORKSPACE/build
msbuild ALL_BUILD.vcxproj /p:Configuration=Release
- name: zip the graphite binary
if: success()
run: |
mkdir $env:GITHUB_WORKSPACE/release
cd $env:GITHUB_WORKSPACE/release
cp $env:GITHUB_WORKSPACE/build/graphite/Release/*.exe .
cp $env:GITHUB_WORKSPACE/3rd/opencv/build/x64/vc16/bin/opencv_world480.dll .
cp $env:GITHUB_WORKSPACE/3rd/opencv/build/bin/opencv_videoio_ffmpeg480_64.dll .
cp $env:GITHUB_WORKSPACE/build/3rd/SDL/Release/SDL2.dll .
Compress-Archive -Path ./* -DestinationPath $env:GITHUB_WORKSPACE/graphite-windows-x86_64.zip
cd $env:GITHUB_WORKSPACE
dir
- name: Collect artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: graphite-windows-x86_64
path: graphite-windows-x86_64.zip
release:
needs:
- build_linux_x64
- build_window_x64
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Show directory structure
run: |
ls -R
- name: Upload artifacts
uses: ncipollo/release-action@v1
with:
commit: master
tag: ${{ github.run_number }}
name: ${{ inputs.name }}
artifacts: "graphite-linux-x86_64/graphite-x86_64.AppImage,graphite-windows-x86_64/graphite-windows-x86_64.zip"