-
Notifications
You must be signed in to change notification settings - Fork 17
103 lines (92 loc) · 2.9 KB
/
build.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
94
95
96
97
98
99
100
101
102
103
name: Build and Upload Packages
on:
push:
branches:
- master
pull_request:
branches:
- master
- release/*
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/nativu5/cranedev:ci
credentials:
username: ${{ github.actor }}
password: ${{ github.token }}
defaults:
run:
shell: bash -leo pipefail {0}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure
run: |
echo "Configuring at $(pwd)"
mkdir -p out
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCRANE_FULL_DYNAMIC=OFF \
-S . -B out
- name: Build
run: |
echo "Building at $(pwd)"
cmake --build out --config Release
- name: Package with CPack
run: |
echo "Packaging with CPack"
pushd out
cpack
popd
- name: Collect packages
run: |
mkdir -p upload/packages
cp out/*.deb upload/packages/ || true
cp out/*.rpm upload/packages/ || true
for package in upload/packages/*; do
package_name=$(basename "$package")
case "$package_name" in
*craned.rpm)
echo "ARTIFACT_NAME_CRANED_RPM=$package_name" >> $GITHUB_ENV
;;
*craned.deb)
echo "ARTIFACT_NAME_CRANED_DEB=$package_name" >> $GITHUB_ENV
;;
*cranectld.rpm)
echo "ARTIFACT_NAME_CRANECTLD_RPM=$package_name" >> $GITHUB_ENV
;;
*cranectld.deb)
echo "ARTIFACT_NAME_CRANECTLD_DEB=$package_name" >> $GITHUB_ENV
;;
esac
done
- name: Upload craned .deb package
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME_CRANED_DEB }}
path: upload/packages/${{ env.ARTIFACT_NAME_CRANED_DEB }}
retention-days: 30
if-no-files-found: error
- name: Upload craned .rpm package
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME_CRANED_RPM }}
path: upload/packages/${{ env.ARTIFACT_NAME_CRANED_RPM }}
retention-days: 30
if-no-files-found: error
- name: Upload cranectld .deb package
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME_CRANECTLD_DEB }}
path: upload/packages/${{ env.ARTIFACT_NAME_CRANECTLD_DEB }}
retention-days: 30
if-no-files-found: error
- name: Upload cranectld .rpm package
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME_CRANECTLD_RPM }}
path: upload/packages/${{ env.ARTIFACT_NAME_CRANECTLD_RPM }}
retention-days: 30
if-no-files-found: error