-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (81 loc) · 2.58 KB
/
macos.yaml
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
# https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60
name: macOS
on:
release:
types: [created]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: "macOS Latest Clang",
os: macos-latest,
artifact: "libpdafusb_macos_clang",
build_type: "Release",
cc: "clang",
cxx: "clang++",
archiver: "7z a",
generators: "Ninja"
}
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Print env
run: |
echo github.event.action: ${{ github.event.action }}
echo github.event_name: ${{ github.event_name }}
- name: Install dependencies on macos
if: startsWith(matrix.config.os, 'macos')
run: |
brew install p7zip cmake ninja
ninja --version
cmake --version
- name: Configure
shell: bash
run: |
mkdir instdir
cmake \
-S . \
-B build \
-DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} \
-G "${{ matrix.config.generators }}" \
-DCMAKE_INSTALL_PREFIX:PATH=instdir
- name: Build
shell: bash
run: cmake --build build --config ${{ matrix.config.build_type }}
- name: Install Strip
shell: bash
run: cmake --install build --strip
- name: Set output
id: get_version
shell: bash
run: |
echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Rename attribute artifact
shell: bash
run: |
echo "artifact=${{ matrix.config.artifact }}-${{ steps.get_version.outputs.VERSION }}.zip" >> $GITHUB_ENV
- name: Pack
shell: bash
working-directory: instdir
run: |
ls -laR
${{ matrix.config.archiver }} ../${{ env.artifact }} .
- name: Upload
uses: actions/upload-artifact@v1
with:
path: ./${{ env.artifact }}
name: ${{ env.artifact }}
- name: Upload release asset
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ env.artifact }}