Skip to content

Commit

Permalink
Fix version field in MODULE.bazel (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum authored Jun 11, 2024
1 parent 35be552 commit 275e5f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,13 @@ jobs:
name: musl-1.2.3-platform-aarch64-apple-darwin-target-aarch64-linux-musl.tar.gz
path: .
- name: Generate MODULE.bazel
run: "touch MODULE.bazel\n\ncat >MODULE.bazel <<'EOF'\nmodule(\n name = \"\
toolchains_musl\",\n version = \"${{github.ref_name}}\",\n)\n\nbazel_dep(name\
\ = \"bazel_features\", version = \"1.9.0\")\nbazel_dep(name = \"platforms\"\
, version = \"0.0.9\")\n\ntoolchains_musl = use_extension(\"//:toolchains_musl.bzl\"\
, \"toolchains_musl\")\nuse_repo(toolchains_musl, \"musl_toolchains_hub\"\
)\n\nregister_toolchains(\"@musl_toolchains_hub//:all\")\nEOF\n"
run: "touch MODULE.bazel\n\nversion=\"${{github.ref_name}}\"\n\ncat >MODULE.bazel\
\ <<EOF\nmodule(\n name = \"toolchains_musl\",\n version = \"${version#v}\"\
,\n)\n\nbazel_dep(name = \"bazel_features\", version = \"1.9.0\")\nbazel_dep(name\
\ = \"platforms\", version = \"0.0.9\")\n\ntoolchains_musl = use_extension(\"\
//:toolchains_musl.bzl\", \"toolchains_musl\")\nuse_repo(toolchains_musl,\
\ \"musl_toolchains_hub\")\n\nregister_toolchains(\"@musl_toolchains_hub//:all\"\
)\nEOF\n"
- name: Generate extensions.bzl
run: "touch toolchains_musl.bzl\n\ncat >toolchains_musl.bzl <<'EOF'\nload(\"\
@bazel_features//:features.bzl\", \"bazel_features\")\nload(\":repositories.bzl\"\
Expand Down
6 changes: 4 additions & 2 deletions generate-actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,12 @@ def generate_release_archive(toolchain_infos, output_path, version):
"name": "Generate MODULE.bazel",
"run": f"""touch MODULE.bazel
cat >MODULE.bazel <<'EOF'
version="{version}"
cat >MODULE.bazel <<EOF
module(
name = "toolchains_musl",
version = "{version.removeprefix('v')}",
version = "${{version#v}}",
)
bazel_dep(name = "bazel_features", version = "1.9.0")
Expand Down

0 comments on commit 275e5f4

Please sign in to comment.