diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index 16c5f85..951471a 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -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" @@ -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 }} diff --git a/libdivide.h b/libdivide.h index b6d0e7b..6c1827c 100644 --- a/libdivide.h +++ b/libdivide.h @@ -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