Skip to content

Commit

Permalink
Add support for automatic nightly versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Maschell committed Jul 21, 2023
1 parent 344213f commit 4712a23
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -18,6 +18,13 @@ jobs:
needs: clang-format
steps:
- 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
run: |
docker build . -t builder
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/pr.yml
Expand Up @@ -15,6 +15,13 @@ jobs:
needs: clang-format
steps:
- 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
run: |
docker build . -t builder
Expand Down
6 changes: 5 additions & 1 deletion src/main.cpp
@@ -1,8 +1,12 @@
#include "version.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_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_LICENSE("GPL");

Expand Down
2 changes: 2 additions & 0 deletions src/version.h
@@ -0,0 +1,2 @@
#pragma once
#define PLUGIN_VERSION_EXTRA ""

0 comments on commit 4712a23

Please sign in to comment.