Compare commits

...

2 Commits

Author SHA1 Message Date
neru 6b63d54eb8 build: modify tags, keep commits of failed runs
Build / build (push) Failing after 2m45s
2026-04-09 06:41:13 -03:00
neru a3df782245 feat: add getExePath 2026-04-09 06:40:34 -03:00
3 changed files with 44 additions and 20 deletions
+22 -20
View File
@@ -22,36 +22,31 @@ jobs:
if: ${{ github.event_name == 'push' }} if: ${{ github.event_name == 'push' }}
shell: bash shell: bash
run: | run: |
git fetch --tags || true git fetch --tags --force
# Determine last tag and log range if LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null); then
if git describe --tags --abbrev=0 >/dev/null 2>&1; then
LAST_TAG=$(git describe --tags --abbrev=0)
RANGE="${LAST_TAG}..HEAD" RANGE="${LAST_TAG}..HEAD"
else else
LAST_TAG="v0.1.9" LAST_TAG="v0.1.9"
RANGE="HEAD" RANGE="HEAD"
fi fi
# Calculate next version
IFS='.' read -r major minor patch <<< "${LAST_TAG#v}" IFS='.' read -r major minor patch <<< "${LAST_TAG#v}"
NEW_VERSION="$major.$minor.$((patch + 1))" NEW_VERSION="$major.$minor.$((patch + 1))"
NEW_TAG="v$NEW_VERSION"
# Log commits
CHANGELOG=$(git log $RANGE --oneline | sed 's/^/* /') CHANGELOG=$(git log $RANGE --oneline | sed 's/^/* /')
[ -z "$CHANGELOG" ] && CHANGELOG="Maintenance build." if [ -z "$CHANGELOG" ]; then
CHANGELOG="Re-run of version $NEW_VERSION or maintenance build."
fi
# Tag and push back to Gitea
git tag $NEW_TAG
git push origin $NEW_TAG
# Set outputs for next steps
echo "version-string=$NEW_VERSION" >> $GITHUB_OUTPUT echo "version-string=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT echo "new-tag=v$NEW_VERSION" >> $GITHUB_OUTPUT
echo "## What's Changed" >> $GITHUB_OUTPUT {
echo "$CHANGELOG" >> $GITHUB_OUTPUT echo "changelog<<EOF"
echo "EOF" >> $GITHUB_OUTPUT echo "## What's Changed"
echo "$CHANGELOG"
echo "EOF"
} >> $GITHUB_OUTPUT
- name: Setup Tools Cache - name: Setup Tools Cache
id: tools-cache id: tools-cache
@@ -124,11 +119,18 @@ jobs:
name: unlocker-build name: unlocker-build
path: unlocker.zip path: unlocker.zip
- name: Finalize Version and Push Tag
if: ${{ github.event_name == 'push' && success() }}
run: |
git tag ${{ steps.calculate-version.outputs.new-tag }}
git push origin ${{ steps.calculate-version.outputs.new-tag }}
- name: Create Gitea Release - name: Create Gitea Release
if: ${{ github.event_name == 'push' }} if: ${{ github.event_name == 'push' && success() }}
uses: akkuman/gitea-release-action@v1 uses: akkuman/gitea-release-action@v1
with: with:
files: unlocker.zip files: unlocker.zip
tag_name: v${{ steps.calculate-version.outputs.version-string }} tag_name: ${{ steps.calculate-version.outputs.new-tag }}
name: Release v${{ steps.calculate-version.outputs.version-string }} name: Release ${{ steps.calculate-version.outputs.new-tag }}
body: ${{ steps.calculate-version.outputs.changelog }} body: ${{ steps.calculate-version.outputs.changelog }}
+14
View File
@@ -0,0 +1,14 @@
#include "utils.h"
#include <minwindef.h>
#include <libloaderapi.h>
std::string utils::getExePath()
{
char buffer[MAX_PATH];
GetModuleFileNameA(NULL, buffer, MAX_PATH);
std::string path(buffer);
size_t pos = path.find_last_of("\\/");
if (pos != std::string::npos) return path.substr(0, pos + 1);
return "";
}
+8
View File
@@ -0,0 +1,8 @@
#pragma once
#include <string>
namespace utils
{
std::string getExePath();
}