chore: cleanup bazel files + sync bzlmod version (#1147)
This commit is contained in:
13
.bazelrc
13
.bazelrc
@@ -1,17 +1,16 @@
|
|||||||
common --enable_bzlmod
|
common --enable_bzlmod
|
||||||
build --enable_platform_specific_config
|
build --enable_platform_specific_config
|
||||||
build --incompatible_use_platforms_repo_for_constraints
|
|
||||||
build --incompatible_enable_cc_toolchain_resolution
|
build --incompatible_enable_cc_toolchain_resolution
|
||||||
build --enable_runfiles
|
build --enable_runfiles
|
||||||
build --incompatible_strict_action_env
|
build --incompatible_strict_action_env
|
||||||
|
|
||||||
# required for googletest
|
# required for googletest
|
||||||
build:linux --cxxopt=-std=c++17
|
build:linux --cxxopt=-std=c++17
|
||||||
build:macos --cxxopt=-std=c++17
|
build:macos --cxxopt=-std=c++17
|
||||||
|
|
||||||
common:ci --announce_rc
|
common:ci --announce_rc
|
||||||
common:ci --verbose_failures
|
common:ci --verbose_failures
|
||||||
common:ci --keep_going
|
common:ci --keep_going
|
||||||
test:ci --test_output=errors
|
test:ci --test_output=errors
|
||||||
|
|
||||||
try-import %workspace%/user.bazelrc
|
try-import %workspace%/user.bazelrc
|
||||||
|
|||||||
3
.github/workflows/bazel-release-archive.yml
vendored
3
.github/workflows/bazel-release-archive.yml
vendored
@@ -13,7 +13,10 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/setup-go@v5
|
||||||
|
- run: go install github.com/bazelbuild/buildtools/buildozer@latest
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- run: ./scripts/sync_bzlmod_version.sh
|
||||||
- run: git archive $GITHUB_REF -o "entt-${GITHUB_REF:10}.tar.gz"
|
- run: git archive $GITHUB_REF -o "entt-${GITHUB_REF:10}.tar.gz"
|
||||||
- run: gh release upload ${GITHUB_REF:10} "entt-${GITHUB_REF:10}.tar.gz"
|
- run: gh release upload ${GITHUB_REF:10} "entt-${GITHUB_REF:10}.tar.gz"
|
||||||
env:
|
env:
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ cpp.hint
|
|||||||
/bazel-*
|
/bazel-*
|
||||||
/test/bazel-*
|
/test/bazel-*
|
||||||
/user.bazelrc
|
/user.bazelrc
|
||||||
|
*.bazel.lock
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
module(
|
module(name = "entt")
|
||||||
name = "entt",
|
|
||||||
version = "3.12.2",
|
|
||||||
compatibility_level = 3012,
|
|
||||||
)
|
|
||||||
|
|
||||||
bazel_dep(name = "rules_cc", version = "0.0.8")
|
bazel_dep(name = "rules_cc", version = "0.0.8")
|
||||||
bazel_dep(name = "bazel_skylib", version = "1.4.2")
|
bazel_dep(name = "bazel_skylib", version = "1.4.2")
|
||||||
|
|||||||
28
scripts/sync_bzlmod_version.sh
Normal file
28
scripts/sync_bzlmod_version.sh
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
|
VERSION_HEADER=$(realpath "$SCRIPT_DIR/../src/entt/config/version.h" --relative-to=$(pwd))
|
||||||
|
BAZEL_MODULE=$(realpath "$SCRIPT_DIR/../MODULE.bazel" --relative-to=$(pwd))
|
||||||
|
|
||||||
|
if [[ -z "${VERSION_HEADER}" ]]; then
|
||||||
|
echo "Cannot find version header"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Getting version from $VERSION_HEADER ..."
|
||||||
|
|
||||||
|
ENTT_MAJOR_VERSION=$(sed -nr 's/#define ENTT_VERSION_MAJOR ([0-9]+)/\1/p' $VERSION_HEADER)
|
||||||
|
ENTT_MINOR_VERSION=$(sed -nr 's/#define ENTT_VERSION_MINOR ([0-9]+)/\1/p' $VERSION_HEADER)
|
||||||
|
ENTT_PATCH_VERSION=$(sed -nr 's/#define ENTT_VERSION_PATCH ([0-9]+)/\1/p' $VERSION_HEADER)
|
||||||
|
|
||||||
|
VERSION="$ENTT_MAJOR_VERSION.$ENTT_MINOR_VERSION.$ENTT_PATCH_VERSION"
|
||||||
|
|
||||||
|
echo "Found $VERSION"
|
||||||
|
|
||||||
|
buildozer "set version $VERSION" //MODULE.bazel:%module
|
||||||
|
|
||||||
|
# a commit is needed for 'git archive'
|
||||||
|
git add $BAZEL_MODULE
|
||||||
|
git commit -m "chore: update MODULE.bazel version to $VERSION"
|
||||||
@@ -1 +1 @@
|
|||||||
import "%workspace%/../.bazelrc"
|
import "%workspace%/../.bazelrc"
|
||||||
|
|||||||
Reference in New Issue
Block a user