-
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (124 loc) · 4.73 KB
/
rolling_release.yml
File metadata and controls
151 lines (124 loc) · 4.73 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
140
141
142
143
144
145
146
147
148
149
150
151
name: rolling release
on:
push:
branches: [ "main" ]
paths: ['**.cpp', '**.h', 'CMakeLists.txt']
workflow_dispatch:
jobs:
win_release:
runs-on: windows-latest
outputs:
win_release_pkg_id: ${{steps.win_release_zip.outputs.artifact-id}}
steps:
- uses: actions/checkout@main
with:
path: OpenWinControls
submodules: true
- name: init submodules
run: |
cd OpenWinControls
git submodule update --init --recursive
- name: prepare release folder
run: mkdir "owc_windows"
- name: build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd OpenWinControls
cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja
ninja -C build
copy build\OpenWinControlsCLI.exe ${{github.workspace}}\owc_windows
- name: upload windows release
id: win_release_zip
uses: actions/upload-artifact@main
with:
name: owc_windows
path: owc_windows
retention-days: 1
linux_release:
runs-on: ubuntu-latest
outputs:
linux_owc_appimg_id: ${{steps.linux_appimg.outputs.artifact-id}}
steps:
- uses: actions/checkout@main
with:
path: OpenWinControls
submodules: true
- name: init submodules
run: |
cd OpenWinControls
git submodule update --init --recursive
- name: install required libs
run: |
sudo apt-get update
sudo apt-get install libudev-dev libusb-1.0-0-dev
- name: download linuxdeploy and plugins
run: |
wget -q --show-progress https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
curl -fsSLo linuxdeploy-plugin-checkrt.sh https://github.com/darealshinji/linuxdeploy-plugin-checkrt/releases/download/continuous/linuxdeploy-plugin-checkrt.sh
chmod +x linuxdeploy-plugin-checkrt.sh
chmod +x linuxdeploy-*.AppImage
- name: prepare release folders
run: mkdir "owc_linux"
- name: build
run: |
cd OpenWinControls
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=usr
make -C build -j`nproc` install
- name: prepare appimage
run: |
mkdir -p OpenWinControls/usr/share/metainfo
mkdir OpenWinControls/AppDir
mv OpenWinControls/usr OpenWinControls/AppDir/usr
cp OpenWinControls/linux/appimage/org.owc.openwincontrolscli.appdata.xml OpenWinControls/AppDir/usr/share/metainfo
- name: make appimage
run: >
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:OpenWinControls/AppDir/usr/lib
./linuxdeploy-x86_64.AppImage
-d OpenWinControls/linux/appimage/org.owc.openwincontrolscli.desktop
-i OpenWinControls/linux/appimage/usr/share/icons/hicolor/256x256/apps/OpenWinControlsCLI.png
--appdir OpenWinControls/AppDir
--plugin checkrt
--output appimage
- name: upload appimage
id: linux_appimg
uses: actions/upload-artifact@main
with:
name: OpenWinControlsCLI-x86_64
path: OpenWinControlsCLI-x86_64.AppImage
retention-days: 1
publish_release:
runs-on: ubuntu-latest
needs: [win_release, linux_release]
steps:
- uses: actions/checkout@main
- name: get release artifacts
uses: actions/download-artifact@main
with:
artifact-ids: ${{needs.win_release.outputs.win_release_pkg_id}},${{needs.linux_release.outputs.linux_owc_appimg_id}}
- name: zip windows release
run: zip -r -9 "OpenWinControlsCLI-Windows.zip" owc_windows
- name: prepare release notes
run: >
echo -e "Continuous build\n\n
[**Changelog**](https://github.com/OpenWinControls/OpenWinControlsCLI/blob/main/CHANGELOG.md)\n\n
### Linux\n\n
Official AUR git package [here](https://aur.archlinux.org/packages/openwincontrolscli-git)" > rel_notes.md
- name: remove old release
env:
GH_TOKEN: ${{ secrets.GTK }}
GH_REPO: ${{ github.repository }}
run: gh release delete continuous -y
continue-on-error: true
- name: publish release
env:
GH_TOKEN: ${{ secrets.GTK }}
GH_REPO: ${{ github.repository }}
run: >
gh release create continuous
OpenWinControlsCLI-Windows.zip
OpenWinControlsCLI-x86_64/OpenWinControlsCLI-x86_64.AppImage
--draft=false
--latest
-t "OpenWinControlsCLI"
-F "rel_notes.md"