-
Notifications
You must be signed in to change notification settings - Fork 3
139 lines (118 loc) · 3.74 KB
/
build.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
name: Build
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build_windows:
name: Build (Windows)
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: "recursive"
- name: Setup MSBuild
uses: microsoft/[email protected]
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: '6.4.1'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2019_64'
install-deps: 'true'
modules: 'qt3d'
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
with:
version: 2.0.9
- name: Make build folder and install Conan dependencies
run: |
mkdir build
conan profile detect --force
conan install . --output-folder=build --build=missing -s build_type=Release
- name: Generate projects
run: |
cd build
cmake --version
cmake -G "Visual Studio 16 2019" ..
- name: Build project
run: |
cd build
cmake --build . --config Release
- name: Move assets to distribution folder
run: |
mkdir dist
mv build/Release/BMEdit.exe dist
mv build/Release/*.dll dist
mv build/Release/styles dist/styles
mv build/Release/platforms dist/platforms
mv build/Release/networkinformation dist/networkinformation
mv build/Release/tls dist/tls
mv build/Release/imageformats dist/imageformats
mv build/Release/iconengines dist/iconengines
mv Assets/g1 dist/g1
mv Assets/scripts dist/scripts
mv Assets/TypesRegistry.json dist
mv README.md dist
- name: Upload build artifacts - BMEdit
uses: actions/upload-artifact@v2
with:
name: "BMEdit"
path: dist
create_release:
name: Create release
needs: [build_windows]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Create release
id: release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.VERSION }}
release_name: ${{ steps.get_version.outputs.VERSION }}
draft: true
prerelease: ${{ contains(github.ref, '-pre') }}
outputs:
upload_url: ${{ steps.release.outputs.upload_url }}
upload_release_asset:
name: Upload release asset
needs: [create_release]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
strategy:
matrix:
artifact: [ "BMEdit" ]
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
- name: Package artifact for release
run: |
cd ${{ matrix.artifact }}
zip -r ${{ matrix.artifact }}.zip *
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ matrix.artifact }}/${{ matrix.artifact }}.zip
asset_name: ${{ matrix.artifact }}.zip
asset_content_type: application/zip