Skip to content

Commit 624c3a0

Browse files
committed
Log the module version on each application start
1 parent b73132e commit 624c3a0

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ jobs:
1818
needs: clang-format
1919
steps:
2020
- uses: actions/checkout@v3
21+
- name: create version.h
22+
run: |
23+
git_hash=$(git rev-parse --short "$GITHUB_SHA")
24+
cat <<EOF > ./src/version.h
25+
#pragma once
26+
#define MODULE_VERSION_EXTRA " (nightly-$git_hash)"
27+
EOF
2128
- name: build binary
2229
run: |
2330
docker build . -t builder

.github/workflows/pr.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ jobs:
1515
needs: clang-format
1616
steps:
1717
- uses: actions/checkout@v3
18+
- name: create version.h
19+
run: |
20+
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
21+
cat <<EOF > ./src/version.h
22+
#pragma once
23+
#define MODULE_VERSION_EXTRA " (nightly-$git_hash)"
24+
EOF
1825
- name: build binary
1926
run: |
2027
docker build . -t builder

src/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ extern "C" {
66
}
77
#endif
88
#include "cacert_pem.h"
9+
#include "version.h"
910
#include <curl/mprintf.h>
1011
#include <wums.h>
1112

1213
WUMS_MODULE_EXPORT_NAME("homebrew_curlwrapper");
1314

15+
#define MODULE_VERSION "v0.1"
16+
1417
WUMS_APPLICATION_STARTS() {
18+
OSReport("Running CURLWrapperModule " MODULE_VERSION MODULE_VERSION_EXTRA "\n");
1519
curl_global_init(CURL_GLOBAL_ALL);
1620
}
1721

src/version.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#pragma once
2+
#define MODULE_VERSION_EXTRA ""

0 commit comments

Comments
 (0)