Skip to content

Commit 3354103

Browse files
authored
feat: publish stardocs on releases, rather than write_source_files (#160)
* feat: publish stardocs on release * cleanup references to docgen * Update release_prep.sh * fixes * updates * don't test root on bazel 6
1 parent aee1f70 commit 3354103

File tree

14 files changed

+22
-43
lines changed

14 files changed

+22
-43
lines changed

.bcr/source.template.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"integrity": "**leave this alone**",
33
"strip_prefix": "{REPO}-{VERSION}",
4+
"docs_url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.docs.tar.gz",
45
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/{REPO}-{TAG}.tar.gz"
56
}

.gitattributes

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# In code review, collapse generated files
2-
docs/*.md linguist-generated=true
3-
41
#################################
52
# Configuration for 'git archive'
63
# See https://git-scm.com/docs/git-archive#ATTRIBUTES

.github/workflows/ci.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424
]
2525
exclude: |
2626
[
27-
{"folder": ".", "bzlmodEnabled": false}
27+
{"folder": ".", "bzlmodEnabled": false},
28+
{"folder": ".", "bazelVersion": "6.4.0"}
2829
]
2930
pre-commit:
3031
runs-on: ubuntu-latest

.github/workflows/release_prep.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ ARCHIVE="rules_mylang-$TAG.tar.gz"
1515
git archive --format=tar --prefix=${PREFIX}/ ${TAG} | gzip > $ARCHIVE
1616
SHA=$(shasum -a 256 $ARCHIVE | awk '{print $1}')
1717

18+
# Add generated API docs to the release, see https://github.com/bazelbuild/bazel-central-registry/issues/5593
19+
docs="$(mktemp -d)"; targets="$(mktemp)"
20+
bazel --output_base="$docs" query --output=label --output_file="$targets" 'kind("starlark_doc_extract rule", //...)'
21+
bazel --output_base="$docs" build --target_pattern_file="$targets"
22+
tar --create --auto-compress \
23+
--directory "$(bazel --output_base="$docs" info bazel-bin)" \
24+
--file "$GITHUB_WORKSPACE/${ARCHIVE%.tar.gz}.docs.tar.gz" .
25+
1826
cat << EOF
1927
## Using Bzlmod with Bazel 6 or greater
2028

.pre-commit-config.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ repos:
2424
- id: destroyed-symlinks
2525
- id: detect-private-key
2626
- id: end-of-file-fixer
27-
exclude: |
28-
(?x)^(
29-
docs/
30-
)
3127
- id: trailing-whitespace
3228
# Check formatting and lint for starlark code
3329
- repo: https://github.com/keith/pre-commit-buildifier

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
docs/*.md

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ license(
1818
text = "LICENSE",
1919
)
2020

21+
# gazelle:map_kind bzl_library bzl_library @bazel_lib//:bzl_library.bzl
2122
gazelle_binary(
2223
name = "gazelle_bin",
2324
languages = ["@bazel_skylib_gazelle_plugin//bzl"],

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ bazel_dep(name = "platforms", version = "0.0.5")
3636

3737
bazel_dep(name = "gazelle", version = "0.35.0", dev_dependency = True, repo_name = "bazel_gazelle")
3838
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.4.1", dev_dependency = True)
39-
bazel_dep(name = "aspect_bazel_lib", version = "1.32.1", dev_dependency = True)
39+
bazel_dep(name = "bazel_lib", version = "3.0.0", dev_dependency = True)
4040
bazel_dep(name = "buildifier_prebuilt", version = "6.1.2", dev_dependency = True)
4141

4242
mylang = use_extension("//mylang:extensions.bzl", "mylang")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Features:
77
- follows the official style guide at https://bazel.build/rules/deploying
88
- allows for both WORKSPACE.bazel and bzlmod (MODULE.bazel) usage
99
- includes Bazel formatting as a pre-commit hook (using [buildifier])
10-
- includes stardoc API documentation generator
10+
- includes API documentation generation
1111
- includes typical toolchain setup
1212
- CI configured with GitHub Actions
1313
- release using GitHub Actions just by pushing a tag

docs/BUILD.bazel

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)