chore: cleanup bazel files + sync bzlmod version (#1147)
This commit is contained in:
1
.bazelrc
1
.bazelrc
@@ -1,6 +1,5 @@
|
||||
common --enable_bzlmod
|
||||
build --enable_platform_specific_config
|
||||
build --incompatible_use_platforms_repo_for_constraints
|
||||
build --incompatible_enable_cc_toolchain_resolution
|
||||
build --enable_runfiles
|
||||
build --incompatible_strict_action_env
|
||||
|
||||
3
.github/workflows/bazel-release-archive.yml
vendored
3
.github/workflows/bazel-release-archive.yml
vendored
@@ -13,7 +13,10 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/setup-go@v5
|
||||
- run: go install github.com/bazelbuild/buildtools/buildozer@latest
|
||||
- uses: actions/checkout@v4
|
||||
- run: ./scripts/sync_bzlmod_version.sh
|
||||
- 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"
|
||||
env:
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -13,3 +13,4 @@ cpp.hint
|
||||
/bazel-*
|
||||
/test/bazel-*
|
||||
/user.bazelrc
|
||||
*.bazel.lock
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
module(
|
||||
name = "entt",
|
||||
version = "3.12.2",
|
||||
compatibility_level = 3012,
|
||||
)
|
||||
module(name = "entt")
|
||||
|
||||
bazel_dep(name = "rules_cc", version = "0.0.8")
|
||||
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"
|
||||
Reference in New Issue
Block a user