Skip to content

Commit 0568a05

Browse files
committed
g
1 parent 8019d8c commit 0568a05

File tree

3 files changed

+70
-10
lines changed

3 files changed

+70
-10
lines changed

.github/workflows/ctest-develop.yml

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,24 @@ jobs:
1313

1414
steps:
1515
- uses: actions/checkout@v4
16-
- name: Cmake Configure
17-
run: cmake -B build -DBUILD_TESTING=ON
18-
- name: Cmake Build
19-
run: cmake --build build
20-
- name: Build Ctest
21-
run: ctest --test-dir build
22-
- name: Execute Test
23-
run: cd build && ctest && cd ..
16+
- name: Cmake
17+
run: |
18+
cmake -B build -DBUILD_TESTING=ON
19+
cmake --build build
20+
ctest --test-dir build
21+
cd build && ctest && cd ..
22+
23+
- name: Package artifacts
24+
run: |
25+
cd build
26+
tar -czvf odrive-lib.tar.gz libOdrive.a
27+
28+
# Upload release artifact to GitHub Releases
29+
- name: Create GitHub Release
30+
uses: softprops/action-gh-release@v1
31+
with:
32+
files: build/odrive-lib.tar.gz
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
36+

.github/workflows/release.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish Multi-Target Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Trigger on version tags like v1.0.0
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Install ARM Toolchain for STM
17+
run: sudo apt-get update && sudo apt-get install -y gcc-arm-none-eabi
18+
19+
# Build Linux version
20+
- name: Build Linux target
21+
run: |
22+
cmake -B build_linux -DCMAKE_INSTALL_PREFIX=lib_linux -DBUILD_TESTING=OFF
23+
cmake --build build_linux
24+
cmake --install build_linux
25+
cd lib_linux && zip -r ../linux_package.zip . && cd ..
26+
27+
# Build STM32 version
28+
- name: Build STM32 target
29+
run: |
30+
cmake -B build_stm -DCMAKE_INSTALL_PREFIX=lib_stm -DBUILD_TESTING=OFF -DTARGET_STM=ON
31+
cmake --build build_stm
32+
cmake --install build_stm
33+
cd lib_stm && zip -r ../stm_package.zip . && cd ..
34+
35+
# Create GitHub release
36+
- name: Create Release
37+
uses: softprops/action-gh-release@v1
38+
with:
39+
tag_name: ${{ github.ref }}
40+
name: Release ${{ github.ref }}
41+
draft: false
42+
prerelease: false
43+
files: |
44+
linux_package.zip
45+
stm_package.zip
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
*.app
3333

3434
# Build Archive
35-
build/
36-
lib/
35+
build*/
36+
lib*/
3737
.vscode/

0 commit comments

Comments
 (0)