-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (102 loc) · 3.92 KB
/
actions.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
name: auto-builds
on: [push, pull_request, workflow_dispatch]
jobs:
build:
# Skip building pull requests from the same repository
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != '${{ github.repository }}'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-latest]
build_type: [Release]
c_compiler: [clang, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
- os: ubuntu-24.04
c_compiler: clang
cpp_compiler: clang++
exclude:
- os: windows-latest
c_compiler: clang
- os: ubuntu-24.04
c_compiler: cl
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v5
- name: Cache Static Qt Install
id: cache-qt6
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v4
with:
path: qt6-binary
key: ${{ runner.os }}-qt6-win64-vc2022-static
- name: Install Static Qt
if: startsWith(runner.os, 'Windows') && (steps.cache-qt6.outputs.cache-hit != 'true')
run: |
Invoke-WebRequest https://github.com/microcai/static-build-qt6/releases/download/qt6_680_msvc_win64/qt6_680_win64_vc2022_static.zip -OutFile .\qt6-binary.zip
expand-archive -path "qt6-binary.zip"
- name: setup env for cmake to pickup QT
id: qt6-install
if: startsWith(runner.os, 'Windows')
shell: bash
run: |
echo "QT_ROOT_DIR=${{ github.workspace }}/qt6-binary/qt6-win64-vc2022-static" >> $GITHUB_ENV
echo "QT_PLUGIN_PATH=${{ github.workspace }}/qt6-binary/qt6-win64-vc2022-static/plugins" >> $GITHUB_ENV
echo "qt_root_dir=${{ github.workspace }}/qt6-binary/qt6-win64-vc2022-static" >> $GITHUB_OUTPUT
echo "qt_plugin_dir=${{ github.workspace }}/qt6-binary/qt6-win64-vc2022-static/plugins" >> $GITHUB_OUTPUT
echo "CMAKE_PREFIX_PATH=${{ github.workspace }}/qt6-binary/qt6-win64-vc2022-static" >> $GITHUB_ENV
- name: setup env for cmake to pickup Clang
if: startsWith(runner.os, 'Linux')
shell: bash
run: |
echo "CC=${{ matrix.c_compiler }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cpp_compiler }}" >> $GITHUB_ENV
- name: Install System Qt
if: startsWith(runner.os, 'Linux')
run: |
sudo apt-get update
sudo apt-get install -y qt6-.+-dev
- name: Enable Developer Command Prompt
if: startsWith(runner.os, 'Windows')
uses: ilammy/[email protected]
- name: Configure Sources
run: >
cmake -G Ninja
-S ${{ github.workspace }}
-B ${{ github.workspace }}/build
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_INSTALL_PREFIX="${{ github.workspace }}/install"
- name: Build Souces
run: cmake --build ${{ github.workspace }}/build
- name: Install Result
run: cmake --install ${{ github.workspace }}/build
- name: zip the result elf
if: startsWith(runner.os, 'Linux')
run: |
cd install/bin
7z a eda-tool-linux.zip edatool
- name: zip the result exe
if: startsWith(runner.os, 'Windows')
run: |
cd install/bin
7z a eda-tool-win64.zip edatool.exe
- name: upload exe Release
if: startsWith(github.ref, 'refs/tags/') && startsWith(runner.os, 'Windows')
uses: softprops/action-gh-release@v2
with:
files: install/bin/eda-tool-win64.zip
- name: upload linux Release
if: startsWith(github.ref, 'refs/tags/') && startsWith(runner.os, 'Linux')
uses: softprops/action-gh-release@v2
with:
files: install/bin/eda-tool-linux.zip
- name: Upload generic artifacts
uses: actions/[email protected]
with:
name: eda-tool-${{ runner.os }}
path: install/bin