forked from sassanh/qnvim
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (116 loc) · 3.79 KB
/
build_cmake.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
# SPDX-FileCopyrightText: 2022 Mikhail Zolotukhin <[email protected]>
# SPDX-License-Identifier: MIT
name: Build plugin
on: [ push, pull_request ]
env:
PLUGIN_NAME: QNVim
QT_VERSION: 5.15.2
CMAKE_VERSION: 3.22.4
NINJA_VERSION: 1.10.1
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
name: "Windows MSVC 2022", artifact: "Windows-x64",
os: windows-2022,
cc: "cl", cxx: "cl",
}
- {
name: "Ubuntu GCC 11", artifact: "Linux-x64",
os: ubuntu-22.04,
cc: "gcc", cxx: "g++"
}
- {
name: "macOS Clang 14", artifact: "macOS-x64",
os: macos-12,
cc: "clang", cxx: "clang++"
}
steps:
- uses: actions/checkout@v3
- name: Download Ninja and CMake
run: cmake -P tools/ci/DownloadNinjaAndCMake.cmake
- name: Install system libs
run: cmake -P tools/ci/InstallSystemLibs.cmake
- name: Download Qt
id: qt
run: cmake -P tools/ci/DownloadQt.cmake
# To create a package, we need a script, that comes with Qt Creator
# This is why we fetch it first, before invoking CMake
- name: Download Qt Creator
id: qt_creator
run: cmake -P tools/DownloadQtCreator.cmake
- name: Download Neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: stable
- name: Setup MSVC environment
uses: ilammy/msvc-dev-cmd@v1
if: ${{ matrix.config.cc == 'cl' }}
- name: Build and Package
run: cmake -P tools/ci/Package.cmake
env:
ARTIFACT_SUFFIX: ${{ matrix.config.artifact }}
CC: ${{ matrix.config.cc }}
CXX: ${{ matrix.config.cxx }}
MACOSX_DEPLOYMENT_TARGET: "10.13"
QT_DIR: ${{ steps.qt.outputs.qt_dir }}
QT_CREATOR_VERSION: ${{ steps.qt_creator.outputs.qtc_ver }}
- uses: actions/upload-artifact@v3
id: upload_artifact
with:
path: ./${{ env.PLUGIN_NAME }}-${{ steps.qt_creator.outputs.qtc_ver }}-${{ matrix.config.artifact }}.7z
name: ${{ env.PLUGIN_NAME}}-${{ steps.qt_creator.outputs.qtc_ver }}-${{ matrix.config.artifact }}.7z
outputs:
qtc_ver: ${{ steps.qt_creator.outputs.qtc_ver }}
release:
if: contains(github.ref, 'tags/v')
runs-on: ubuntu-20.04
needs: build
steps:
- name: Create Release
id: create_release
run: |
gh release -R ${{ github.repository }} create ${{ github.ref_name }} -t "${{ env.NAME }}"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NAME: Release ${{ github.ref_name }}
outputs:
qtc_ver: ${{ needs.build.outputs.qtc_ver }}
publish:
if: contains(github.ref, 'tags/v')
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {
name: "Windows Latest x64", artifact: "Windows-x64.7z",
os: ubuntu-22.04
}
- {
name: "Linux Latest x64", artifact: "Linux-x64.7z",
os: ubuntu-22.04
}
- {
name: "macOS Latest x64", artifact: "macOS-x64.7z",
os: macos-12
}
needs: release
steps:
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-${{ needs.release.outputs.qtc_ver }}-${{ matrix.config.artifact }}
path: ./
- name: Upload to Release
id: upload_to_release
run: |
gh release -R ${{ github.repository }} upload ${{ github.ref_name }} ${{ env.ASSET_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ASSET_PATH: ./${{ env.PLUGIN_NAME }}-${{ needs.release.outputs.qtc_ver }}-${{ matrix.config.artifact }}