Skip to content

Commit

Permalink
Embed version string directly in libdivide.h
Browse files Browse the repository at this point in the history
  • Loading branch information
adbancroft committed Oct 28, 2024
1 parent 84ba77f commit 041eba5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ jobs:
$new_version=@($major_ver, $minor_ver, $patch_ver) -Join "."
# Update header file
$header = $header -replace "#define LIBDIVIDE_VERSION ""\d+\.\d+\.\d+""", "#define LIBDIVIDE_VERSION_MAJOR ""$new_version"""
$header = $header -replace "#define LIBDIVIDE_VERSION_MAJOR \d+", "#define LIBDIVIDE_VERSION_MAJOR $major_ver"
$header = $header -replace "#define LIBDIVIDE_VERSION_MINOR \d+", "#define LIBDIVIDE_VERSION_MINOR $minor_ver"
$header = $header -replace "#define LIBDIVIDE_VERSION_PATCH \d+", "#define LIBDIVIDE_VERSION_PATCH $patch_ver"
Expand All @@ -77,7 +78,7 @@ jobs:
Write-Output "patch=$patch_ver" >> $Env:GITHUB_OUTPUT
# Commit all changed files back to the repository
- name: Checkout code
- name: Commit updated versions
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Auto increment version to ${{ steps.bump_version.outputs.version }}
Expand Down
5 changes: 2 additions & 3 deletions libdivide.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@
#ifndef LIBDIVIDE_H
#define LIBDIVIDE_H

// *** Version numbers are auto generated - do not edit ***
#define LIBDIVIDE_VERSION "5.1.0"
#define LIBDIVIDE_VERSION_MAJOR 5
#define LIBDIVIDE_VERSION_MINOR 1
#define LIBDIVIDE_VERSION_PATCH 0
#define LIBDIVIDE_STR_INNER(s) #s
#define LIBDIVIDE_STR(s) LIBDIVIDE_STR_INNER(s)
#define LIBDIVIDE_VERSION (LIBDIVIDE_STR(LIBDIVIDE_VERSION_MAJOR) "." LIBDIVIDE_STR(LIBDIVIDE_VERSION_MINOR) "." LIBDIVIDE_STR(LIBDIVIDE_VERSION_PATCH))

#include <stdint.h>

Expand Down

0 comments on commit 041eba5

Please sign in to comment.