-
Notifications
You must be signed in to change notification settings - Fork 215
151 lines (132 loc) · 5.09 KB
/
main.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
name: ROS Qt Creator plugin build and archive release
on: [push, pull_request]
jobs:
build:
name: build (${{ matrix.config.name }})
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- { name: "Linux", os: ubuntu-20.04 }
- { name: "Windows", os: windows-latest }
- { name: "macOS", os: macos-latest }
outputs:
archive_name: ${{ steps.find_plugin_archive.outputs.archive_name }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: conda-incubator/setup-miniconda@v2
if: runner.os == 'Windows'
- name: install Microsoft Visual C++ (Windows)
uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
- name: install Linux system dependencies
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install libgl1-mesa-dev ninja-build libqtermwidget5-0-dev libutf8proc-dev
- name: install Windows system dependencies
if: runner.os == 'Windows'
run: |
choco install ninja
- name: install macOS system dependencies
if: runner.os == 'macOS'
run: brew install ninja qt5
- name: install yaml-cpp
shell: bash
run: |
git clone --depth 1 https://github.com/jbeder/yaml-cpp.git extern/yaml-cpp --branch yaml-cpp-0.7.0
cd extern/yaml-cpp
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DYAML_CPP_BUILD_TESTS=OFF
$(which sudo) cmake --build build --target install
- name: set build environment variables (Windows)
if: runner.os == 'Windows'
shell: bash
run: |
echo "YAML_DIR='C:/Program Files (x86)/YAML_CPP/share/cmake/yaml-cpp/'" >> $GITHUB_ENV
- name: install Qt and Qt Creator
shell: bash
run: |
pip install pyyaml requests py7zr
python setup.py --export_variables
cat env >> $GITHUB_ENV
- name: install qtermwidget
if: runner.os == 'macOS'
shell: bash
run: |
git clone https://github.com/lxqt/lxqt-build-tools.git extern/lxqt-build-tools
cd extern/lxqt-build-tools
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DQt5Core_DIR=$(brew --prefix qt5)/lib/cmake/Qt5Core
cmake --build build --target install
cd ../..
git clone https://github.com/lxqt/qtermwidget.git extern/qtermwidget
cd extern/qtermwidget
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DQt5Core_DIR=$(brew --prefix qt5)/lib/cmake/Qt5Core -DQt5Widgets_DIR=$(brew --prefix qt5)/lib/cmake/Qt5Widgets -DQt5LinguistTools_DIR=$(brew --prefix qt5)/lib/cmake/Qt5LinguistTools
cmake --build build --target install
- name: build plugin
run: |
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="${{ env.QTC_PATH }};${{ env.QT_PATH }}" -Dyaml-cpp_DIR=${{ env.YAML_DIR }} -DBUILD_ROSTERMINAL=OFF
cmake --build build --target package
- name: find plugin archive
id: find_plugin_archive
shell: bash
run: |
find build/ -maxdepth 1 -name 'ROSProjectManager-*-*-*.zip' -print0 | xargs -0 basename -a > ./archive_name
echo "QTC_PLUGIN_ARCHIVE=`cat ./archive_name`" >> $GITHUB_ENV
- name: upload artifact
uses: actions/upload-artifact@v3
with:
name: plugin_archive_artifact_${{ matrix.config.name }}
if-no-files-found: error
path: |
./build/${{ env.QTC_PLUGIN_ARCHIVE }}
./archive_name
release:
name: create release
if: contains(github.ref, '/tags/')
runs-on: ubuntu-latest
needs: build
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: create release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
publish:
name: publish plugin archive (${{ matrix.name }})
if: contains(github.ref, '/tags/')
runs-on: ubuntu-latest
needs: [build, release]
strategy:
matrix:
name:
- Linux
- Windows
- macOS
steps:
- name: download artifact
uses: actions/download-artifact@v3
with:
name: plugin_archive_artifact_${{ matrix.name }}
path: ./
- name: set archive name
shell: bash
run: echo "QTC_PLUGIN_ARCHIVE=`cat ./archive_name`" >> $GITHUB_ENV
- name: upload archive release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{needs.release.outputs.upload_url}}
asset_path: ./build/${{ env.QTC_PLUGIN_ARCHIVE }}
asset_name: ${{ env.QTC_PLUGIN_ARCHIVE }}
asset_content_type: application/zip