8989 runs-on : ubuntu-22.04
9090 permissions :
9191 contents : write
92+ env :
93+ TAG_NAME : commit-${{ github.sha }}
9294 steps :
9395 - name : Download artifacts
9496 uses : actions/download-artifact@v4
@@ -101,11 +103,21 @@ jobs:
101103
102104 shopt -s globstar # enable recursive globbing
103105
104- echo '```' > release_body.txt
106+ echo '```bazel ' > release_body.txt
105107 echo 'http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")' >> release_body.txt
106108 echo '' >> release_body.txt
107109
108- echo 'cargo_bazel_url = "https://github.com/${{ github.repository }}/releases/download/commit-${{ github.sha }}/"' >> release_body.txt
110+ cat >> release_body.txt <<EOF
111+ bazel_dep(name = "rules_rust")
112+
113+ git_override(
114+ module_name = "rules_rust",
115+ commit = "${{ github.sha }}",
116+ remote = "https://github.com/${{ github.repository }}.git",
117+ )
118+ EOF
119+
120+ echo 'cargo_bazel_url = "https://github.com/${{ github.repository }}/releases/download/${{ env.TAG_NAME }}/"' >> release_body.txt
109121 echo '' >> release_body.txt
110122
111123 for archive in ./artifacts/**/*.tar.zst; do
@@ -131,7 +143,7 @@ jobs:
131143 - name : Create GitHub Release
132144 uses : softprops/action-gh-release@v2
133145 with :
134- tag_name : commit- ${{ github.sha }}
146+ tag_name : ${{ env.TAG_NAME }}
135147 name : " cargo-bazel build for ${{ github.sha }}"
136148 body_path : release_body.txt
137149 files : ./artifacts/**/*.tar.zst
0 commit comments