Add support for automatic nightly versions

This commit is contained in:
Maschell 2023-07-21 19:32:27 +02:00
parent 344213f695
commit 4712a23712
4 changed files with 21 additions and 1 deletions

View File

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

View File

@ -15,6 +15,13 @@ jobs:
needs: clang-format needs: clang-format
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- 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 PLUGIN_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,8 +1,12 @@
#include "version.h"
#include <wups.h> #include <wups.h>
#define PLUGIN_VERSION "v0.2.1"
#define PLUGIN_VERSION_FULL PLUGIN_VERSION PLUGIN_VERSION_EXTRA
WUPS_PLUGIN_NAME("drc_region_free_plugin"); WUPS_PLUGIN_NAME("drc_region_free_plugin");
WUPS_PLUGIN_DESCRIPTION("Allows the usage of gamepads from every region"); WUPS_PLUGIN_DESCRIPTION("Allows the usage of gamepads from every region");
WUPS_PLUGIN_VERSION("0.2.1"); WUPS_PLUGIN_VERSION(PLUGIN_VERSION_FULL);
WUPS_PLUGIN_AUTHOR("Maschell"); WUPS_PLUGIN_AUTHOR("Maschell");
WUPS_PLUGIN_LICENSE("GPL"); WUPS_PLUGIN_LICENSE("GPL");

2
src/version.h Normal file
View File

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