-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (100 loc) · 3.32 KB
/
Copy pathrelease.yml
File metadata and controls
124 lines (100 loc) · 3.32 KB
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
name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: write
packages: write
jobs:
build-release:
name: Build release binaries (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
artifact: cpp-lin-cli-linux-amd64
ext: ""
- os: macos-14
artifact: cpp-lin-cli-macos-arm64
ext: ""
- os: windows-2022
artifact: cpp-lin-cli-windows-amd64
ext: ".exe"
steps:
- uses: actions/checkout@v4
- name: Set up MSVC (Windows)
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Configure
shell: bash
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17
- name: Build CLI
run: cmake --build build --parallel --target cpp-lin-cli --config Release
- name: Run tests
run: ctest --test-dir build --output-on-failure -j1
- name: Stage artifact (Unix)
if: runner.os != 'Windows'
run: |
cp build/cli/cpp-lin-cli ${{ matrix.artifact }}
chmod +x ${{ matrix.artifact }}
- name: Stage artifact (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: Copy-Item build\cli\Release\cpp-lin-cli.exe ${{ matrix.artifact }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}${{ matrix.ext }}
github-release:
name: Create GitHub Release
runs-on: ubuntu-22.04
needs: build-release
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist/
- name: Flatten dist directory
run: find dist -type f -exec mv {} dist/ \; || true
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> "$GITHUB_ENV"
- name: Generate checksums
working-directory: dist
run: |
sha256sum cpp-lin-cli-* > SHA256SUMS.txt
cat SHA256SUMS.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: "cpp-LIN ${{ github.ref_name }}"
tag_name: ${{ github.ref_name }}
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
body: |
## cpp-LIN ${{ github.ref_name }}
C++ LIN bus library — RELAY-conformant, ISO 26262 ASIL-B.
### Assets
| Platform | Binary |
|----------|--------|
| Linux (amd64) | `cpp-lin-cli-linux-amd64` |
| macOS (arm64) | `cpp-lin-cli-macos-arm64` |
| Windows (amd64) | `cpp-lin-cli-windows-amd64.exe` |
### Verification
```sh
sha256sum --check SHA256SUMS.txt
```
### What's Changed
See [CHANGELOG](https://github.com/SoundMatt/cpp-LIN/blob/main/CHANGELOG.md)
for the full list of changes in this release.
files: |
dist/cpp-lin-cli-linux-amd64
dist/cpp-lin-cli-macos-arm64
dist/cpp-lin-cli-windows-amd64.exe
dist/SHA256SUMS.txt