-
Notifications
You must be signed in to change notification settings - Fork 2
205 lines (155 loc) · 5.98 KB
/
release.yml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
name: Release
on: [push]
permissions:
contents: write
env:
BUILD_TYPE: Release
jobs:
build-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get dependencies
run: ${{github.workspace}}/scripts/prepare-ubuntu.sh
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Package
working-directory: ${{github.workspace}}/build
run: cpack
- uses: actions/upload-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-linux
path: ${{github.workspace}}/build/GoOdf*.tar.gz
build-appimage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get dependencies
run: ${{github.workspace}}/scripts/prepare-ubuntu-appimage.sh
- name: Read version file
shell: bash
working-directory: ${{github.workspace}}
id: read_version
run: |
VERSION_TXT=$(< version.txt)
echo "app_version=${VERSION_TXT}" >> $GITHUB_ENV
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Install
working-directory: ${{github.workspace}}/build
run: make install DESTDIR=AppDir
- name: Create Appimage
working-directory: ${{github.workspace}}/build
run: |
echo "DEPLOY_GTK_VERSION=3" >> $GITHUB_ENV
echo "APPIMAGE_EXTRACT_AND_RUN=1" >> $GITHUB_ENV
linuxdeploy-x86_64.AppImage --appdir AppDir -e ./bin/GoOdf -d ./share/GoOdf/applications/GoOdf.desktop -i ./share/icons/hicolor/256x256/apps/GoOdf.png --plugin gtk
appimagetool-x86_64.AppImage --no-appstream AppDir GoOdf-${{env.app_version}}.x86_64.AppImage
- uses: actions/upload-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-AppImage
path: ${{github.workspace}}/build/GoOdf*.AppImage
build-cross-windows:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get dependencies
run: ${{github.workspace}}/scripts/prepare-ubuntu-cross.sh
- name: Get cross-compiled wxWidgets
run: |
wget https://github.com/larspalo/WxWidgetsCross/releases/download/3.2.3-2.go/wxwidgets3-mingw-w64-static_3.2.3-2.go_all.deb
sudo apt-get install -y ./wxwidgets3-mingw-w64-static_3.2.3-2.go_all.deb
- name: Configure CMake
run: cmake -B ${{github.workspace}}/crossbuild -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchain.def
- name: Build
run: cmake --build ${{github.workspace}}/crossbuild --config ${{env.BUILD_TYPE}}
- name: Package
working-directory: ${{github.workspace}}/crossbuild
run: cpack
- uses: actions/upload-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-windows
path: ${{github.workspace}}/crossbuild/GoOdf*.zip
build-macos-x86:
runs-on: macos-13
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get dependencies
run: ${{github.workspace}}/scripts/prepare-osx.sh
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build with CMake
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Package with CPack
working-directory: ${{github.workspace}}/build
run: cpack
- uses: actions/upload-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-macos-x86
path: ${{ github.workspace }}/build/GoOdf*.dmg
build-macos-arm:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Get dependencies
run: ${{github.workspace}}/scripts/prepare-osx.sh
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build with CMake
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Package with CPack
working-directory: ${{github.workspace}}/build
run: cpack
- uses: actions/upload-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-macos-arm
path: ${{ github.workspace }}/build/GoOdf*.dmg
release:
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
needs: [ build-linux, build-appimage, build-cross-windows, build-macos-x86, build-macos-arm ]
name: Create GitHub Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-linux
- uses: actions/download-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-AppImage
- uses: actions/download-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-windows
- uses: actions/download-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-macos-x86
- uses: actions/download-artifact@v4
with:
name: GoOdf-${{github.ref_name}}-macos-arm
- name: Remove Starting v From Tag
id: remove_v
run: |
TAG=${{github.ref_name}}
echo "release_version=${TAG#v}" >> $GITHUB_ENV
- name: Populate Release
uses: softprops/action-gh-release@v1
with:
draft: false
prerelease: false
body: Release files created from GitHub action runners.
files: |
GoOdf-${{env.release_version}}-linux.x86_64.tar.gz
GoOdf-${{env.release_version}}.x86_64.AppImage
GoOdf-${{env.release_version}}-windows.x86_64.zip
GoOdf-${{env.release_version}}-macOS.x86_64.dmg
GoOdf-${{env.release_version}}-macOS.arm64.dmg