Support using the git hash on nightlies

This commit is contained in:
Maschell 2022-10-06 23:12:45 +02:00
parent 937e259f4c
commit 4177052fb7
5 changed files with 21 additions and 13 deletions

View File

@ -18,6 +18,13 @@ jobs:
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "$GITHUB_SHA")
cat <<EOF > ./src/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary - name: build binary
run: | run: |
docker build . -t builder docker build . -t builder

View File

@ -26,6 +26,13 @@ jobs:
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: create version.h
run: |
git_hash=$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")
cat <<EOF > ./src/version.h
#pragma once
#define VERSION_EXTRA " (nightly-$git_hash)"
EOF
- name: build binary - name: build binary
run: | run: |
docker build . -t builder docker build . -t builder

View File

@ -1,3 +1,4 @@
#include "main.h"
#include "globals.h" #include "globals.h"
#include "utils/TcpReceiver.h" #include "utils/TcpReceiver.h"
#include "utils/logger.h" #include "utils/logger.h"
@ -8,7 +9,7 @@
WUPS_PLUGIN_NAME("Wiiload"); WUPS_PLUGIN_NAME("Wiiload");
WUPS_PLUGIN_DESCRIPTION("Wiiload Server"); WUPS_PLUGIN_DESCRIPTION("Wiiload Server");
WUPS_PLUGIN_VERSION("0.1"); WUPS_PLUGIN_VERSION(VERSION_FULL);
WUPS_PLUGIN_AUTHOR("Maschell"); WUPS_PLUGIN_AUTHOR("Maschell");
WUPS_PLUGIN_LICENSE("GPL"); WUPS_PLUGIN_LICENSE("GPL");

View File

@ -1,14 +1,5 @@
#pragma once #pragma once
#include "version.h"
/* Main */ #define VERSION "v0.1"
#ifdef __cplusplus #define VERSION_FULL VERSION VERSION_EXTRA
extern "C" {
#endif
#include <cstdint>
#include <nsysnet/socket.h>
#ifdef __cplusplus
}
#endif
#endif

2
src/version.h Normal file
View File

@ -0,0 +1,2 @@
#pragma once
#define VERSION_EXTRA ""