blockwatch-cli 0.11.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. blockwatch_cli-0.11.1/.agents/.claude-plugin/plugin.json +13 -0
  2. blockwatch_cli-0.11.1/.agents/skills/blockwatch/SKILL.md +14 -0
  3. blockwatch_cli-0.11.1/.claude-plugin/marketplace.json +17 -0
  4. blockwatch_cli-0.11.1/.github/dependabot.yml +20 -0
  5. blockwatch_cli-0.11.1/.github/workflows/blockwatch.yml +24 -0
  6. blockwatch_cli-0.11.1/.github/workflows/codeql.yml +101 -0
  7. blockwatch_cli-0.11.1/.github/workflows/markdownlint.yml +27 -0
  8. blockwatch_cli-0.11.1/.github/workflows/pypi.yml +80 -0
  9. blockwatch_cli-0.11.1/.github/workflows/release.yml +343 -0
  10. blockwatch_cli-0.11.1/.github/workflows/rust.yml +43 -0
  11. blockwatch_cli-0.11.1/.github/workflows/trusted-checks.yml +27 -0
  12. blockwatch_cli-0.11.1/.gitignore +36 -0
  13. blockwatch_cli-0.11.1/.markdownlint-cli2.yaml +27 -0
  14. blockwatch_cli-0.11.1/.pre-commit-config.yaml +49 -0
  15. blockwatch_cli-0.11.1/.pre-commit-hooks.yaml +22 -0
  16. blockwatch_cli-0.11.1/AGENTS.md +290 -0
  17. blockwatch_cli-0.11.1/CHANGELOG.md +517 -0
  18. blockwatch_cli-0.11.1/CLAUDE.md +290 -0
  19. blockwatch_cli-0.11.1/Cargo.lock +3217 -0
  20. blockwatch_cli-0.11.1/Cargo.toml +96 -0
  21. blockwatch_cli-0.11.1/LICENSE +21 -0
  22. blockwatch_cli-0.11.1/PKG-INFO +9 -0
  23. blockwatch_cli-0.11.1/README.md +310 -0
  24. blockwatch_cli-0.11.1/SECURITY.md +53 -0
  25. blockwatch_cli-0.11.1/blockwatch.toml +6 -0
  26. blockwatch_cli-0.11.1/clippy.toml +5 -0
  27. blockwatch_cli-0.11.1/codecov.yml +14 -0
  28. blockwatch_cli-0.11.1/demo.gif +0 -0
  29. blockwatch_cli-0.11.1/dist-workspace.toml +47 -0
  30. blockwatch_cli-0.11.1/docs/agents.md +73 -0
  31. blockwatch_cli-0.11.1/docs/ci.md +326 -0
  32. blockwatch_cli-0.11.1/docs/cli.md +896 -0
  33. blockwatch_cli-0.11.1/docs/symbols.md +194 -0
  34. blockwatch_cli-0.11.1/docs/validators/README.md +111 -0
  35. blockwatch_cli-0.11.1/docs/validators/affects.md +128 -0
  36. blockwatch_cli-0.11.1/docs/validators/check-ai.md +89 -0
  37. blockwatch_cli-0.11.1/docs/validators/check-lua.md +197 -0
  38. blockwatch_cli-0.11.1/docs/validators/keep-sorted.md +105 -0
  39. blockwatch_cli-0.11.1/docs/validators/keep-unique.md +51 -0
  40. blockwatch_cli-0.11.1/docs/validators/line-count.md +29 -0
  41. blockwatch_cli-0.11.1/docs/validators/line-pattern.md +63 -0
  42. blockwatch_cli-0.11.1/docs/validators/same-as.md +314 -0
  43. blockwatch_cli-0.11.1/pypi/pyproject.toml +16 -0
  44. blockwatch_cli-0.11.1/pyproject.toml +14 -0
  45. blockwatch_cli-0.11.1/release.toml +76 -0
  46. blockwatch_cli-0.11.1/scripts/check_latest_gpt_nano_model.lua +66 -0
  47. blockwatch_cli-0.11.1/setup.py +13 -0
  48. blockwatch_cli-0.11.1/src/block_parser.rs +1495 -0
  49. blockwatch_cli-0.11.1/src/blocks.rs +3256 -0
  50. blockwatch_cli-0.11.1/src/cli.rs +389 -0
  51. blockwatch_cli-0.11.1/src/config.rs +908 -0
  52. blockwatch_cli-0.11.1/src/diff_parser.rs +1526 -0
  53. blockwatch_cli-0.11.1/src/flags.rs +630 -0
  54. blockwatch_cli-0.11.1/src/fs.rs +744 -0
  55. blockwatch_cli-0.11.1/src/language_parsers/bash.rs +93 -0
  56. blockwatch_cli-0.11.1/src/language_parsers/c.rs +85 -0
  57. blockwatch_cli-0.11.1/src/language_parsers/c_sharp.rs +91 -0
  58. blockwatch_cli-0.11.1/src/language_parsers/cmake.rs +93 -0
  59. blockwatch_cli-0.11.1/src/language_parsers/cpp.rs +84 -0
  60. blockwatch_cli-0.11.1/src/language_parsers/css.rs +85 -0
  61. blockwatch_cli-0.11.1/src/language_parsers/dart.rs +69 -0
  62. blockwatch_cli-0.11.1/src/language_parsers/dockerfile.rs +157 -0
  63. blockwatch_cli-0.11.1/src/language_parsers/elixir.rs +62 -0
  64. blockwatch_cli-0.11.1/src/language_parsers/go.rs +239 -0
  65. blockwatch_cli-0.11.1/src/language_parsers/graphql.rs +88 -0
  66. blockwatch_cli-0.11.1/src/language_parsers/groovy.rs +73 -0
  67. blockwatch_cli-0.11.1/src/language_parsers/hcl.rs +69 -0
  68. blockwatch_cli-0.11.1/src/language_parsers/html.rs +89 -0
  69. blockwatch_cli-0.11.1/src/language_parsers/java.rs +152 -0
  70. blockwatch_cli-0.11.1/src/language_parsers/javascript.rs +103 -0
  71. blockwatch_cli-0.11.1/src/language_parsers/json.rs +235 -0
  72. blockwatch_cli-0.11.1/src/language_parsers/json.scm +4 -0
  73. blockwatch_cli-0.11.1/src/language_parsers/kotlin.rs +86 -0
  74. blockwatch_cli-0.11.1/src/language_parsers/lua.rs +95 -0
  75. blockwatch_cli-0.11.1/src/language_parsers/makefile.rs +61 -0
  76. blockwatch_cli-0.11.1/src/language_parsers/markdown.rs +499 -0
  77. blockwatch_cli-0.11.1/src/language_parsers/mod.rs +870 -0
  78. blockwatch_cli-0.11.1/src/language_parsers/nix.rs +65 -0
  79. blockwatch_cli-0.11.1/src/language_parsers/php.rs +285 -0
  80. blockwatch_cli-0.11.1/src/language_parsers/proto.rs +71 -0
  81. blockwatch_cli-0.11.1/src/language_parsers/python.rs +79 -0
  82. blockwatch_cli-0.11.1/src/language_parsers/ruby.rs +142 -0
  83. blockwatch_cli-0.11.1/src/language_parsers/rust.rs +125 -0
  84. blockwatch_cli-0.11.1/src/language_parsers/scala.rs +90 -0
  85. blockwatch_cli-0.11.1/src/language_parsers/sql.rs +99 -0
  86. blockwatch_cli-0.11.1/src/language_parsers/starlark.rs +60 -0
  87. blockwatch_cli-0.11.1/src/language_parsers/swift.rs +91 -0
  88. blockwatch_cli-0.11.1/src/language_parsers/toml.rs +683 -0
  89. blockwatch_cli-0.11.1/src/language_parsers/tsx.rs +127 -0
  90. blockwatch_cli-0.11.1/src/language_parsers/typescript.rs +117 -0
  91. blockwatch_cli-0.11.1/src/language_parsers/xml.rs +70 -0
  92. blockwatch_cli-0.11.1/src/language_parsers/yaml.rs +1008 -0
  93. blockwatch_cli-0.11.1/src/lib.rs +224 -0
  94. blockwatch_cli-0.11.1/src/main.rs +3 -0
  95. blockwatch_cli-0.11.1/src/path_arguments.rs +189 -0
  96. blockwatch_cli-0.11.1/src/paths_glob.rs +92 -0
  97. blockwatch_cli-0.11.1/src/repo_path.rs +542 -0
  98. blockwatch_cli-0.11.1/src/report.rs +429 -0
  99. blockwatch_cli-0.11.1/src/sarif.rs +759 -0
  100. blockwatch_cli-0.11.1/src/settings.rs +518 -0
  101. blockwatch_cli-0.11.1/src/skill.md +418 -0
  102. blockwatch_cli-0.11.1/src/symbol_path.rs +475 -0
  103. blockwatch_cli-0.11.1/src/symbols.rs +1392 -0
  104. blockwatch_cli-0.11.1/src/tag_parser.rs +285 -0
  105. blockwatch_cli-0.11.1/src/validators/affects.rs +1442 -0
  106. blockwatch_cli-0.11.1/src/validators/check_ai.rs +636 -0
  107. blockwatch_cli-0.11.1/src/validators/check_lua.rs +1583 -0
  108. blockwatch_cli-0.11.1/src/validators/keep_sorted.rs +1109 -0
  109. blockwatch_cli-0.11.1/src/validators/keep_unique.rs +514 -0
  110. blockwatch_cli-0.11.1/src/validators/line_count.rs +441 -0
  111. blockwatch_cli-0.11.1/src/validators/line_pattern.rs +559 -0
  112. blockwatch_cli-0.11.1/src/validators/mod.rs +2073 -0
  113. blockwatch_cli-0.11.1/src/validators/same_as.rs +1806 -0
  114. blockwatch_cli-0.11.1/src/violation_address.rs +363 -0
  115. blockwatch_cli-0.11.1/src/virtual_blocks.rs +601 -0
  116. blockwatch_cli-0.11.1/tests/affects.rs +881 -0
  117. blockwatch_cli-0.11.1/tests/check_ai.rs +207 -0
  118. blockwatch_cli-0.11.1/tests/check_lua.rs +283 -0
  119. blockwatch_cli-0.11.1/tests/common/empty.toml +1 -0
  120. blockwatch_cli-0.11.1/tests/common/mod.rs +116 -0
  121. blockwatch_cli-0.11.1/tests/config.rs +445 -0
  122. blockwatch_cli-0.11.1/tests/encoding.rs +120 -0
  123. blockwatch_cli-0.11.1/tests/general.rs +505 -0
  124. blockwatch_cli-0.11.1/tests/keep_sorted.rs +277 -0
  125. blockwatch_cli-0.11.1/tests/keep_unique.rs +89 -0
  126. blockwatch_cli-0.11.1/tests/line_count.rs +94 -0
  127. blockwatch_cli-0.11.1/tests/line_pattern.rs +105 -0
  128. blockwatch_cli-0.11.1/tests/list.rs +336 -0
  129. blockwatch_cli-0.11.1/tests/path_arguments.rs +222 -0
  130. blockwatch_cli-0.11.1/tests/repository_root.rs +146 -0
  131. blockwatch_cli-0.11.1/tests/same_as.rs +161 -0
  132. blockwatch_cli-0.11.1/tests/sarif.rs +165 -0
  133. blockwatch_cli-0.11.1/tests/skill.rs +66 -0
  134. blockwatch_cli-0.11.1/tests/suppressions.rs +375 -0
  135. blockwatch_cli-0.11.1/tests/symbol_references.rs +70 -0
  136. blockwatch_cli-0.11.1/tests/testdata/affects/cross_file_source.rs +3 -0
  137. blockwatch_cli-0.11.1/tests/testdata/affects/cross_file_target.md +5 -0
  138. blockwatch_cli-0.11.1/tests/testdata/affects/custom_ext_source.javascript +3 -0
  139. blockwatch_cli-0.11.1/tests/testdata/affects/custom_ext_target.javascript +3 -0
  140. blockwatch_cli-0.11.1/tests/testdata/affects/dangling.md +6 -0
  141. blockwatch_cli-0.11.1/tests/testdata/affects/missing_symbol.rs +3 -0
  142. blockwatch_cli-0.11.1/tests/testdata/affects/more_added_than_deleted.py +9 -0
  143. blockwatch_cli-0.11.1/tests/testdata/affects/multiline_tag_source.rs +5 -0
  144. blockwatch_cli-0.11.1/tests/testdata/affects/multiline_tag_target.rs +5 -0
  145. blockwatch_cli-0.11.1/tests/testdata/affects/nested_mapping_source.rs +3 -0
  146. blockwatch_cli-0.11.1/tests/testdata/affects/nested_mapping_target.yaml +4 -0
  147. blockwatch_cli-0.11.1/tests/testdata/affects/sibling.md +11 -0
  148. blockwatch_cli-0.11.1/tests/testdata/affects/symbol_source.rs +3 -0
  149. blockwatch_cli-0.11.1/tests/testdata/affects/symbol_target.json +4 -0
  150. blockwatch_cli-0.11.1/tests/testdata/affects/table_source.rs +3 -0
  151. blockwatch_cli-0.11.1/tests/testdata/affects/table_target.toml +9 -0
  152. blockwatch_cli-0.11.1/tests/testdata/affects/tag_and_content_source.ts +3 -0
  153. blockwatch_cli-0.11.1/tests/testdata/affects/tag_and_content_target.ts +4 -0
  154. blockwatch_cli-0.11.1/tests/testdata/affects/whole_file_source.rs +4 -0
  155. blockwatch_cli-0.11.1/tests/testdata/affects/whole_file_target.json +3 -0
  156. blockwatch_cli-0.11.1/tests/testdata/check_ai/two_blocks.py +9 -0
  157. blockwatch_cli-0.11.1/tests/testdata/check_lua/affects.lua +14 -0
  158. blockwatch_cli-0.11.1/tests/testdata/check_lua/affects.py +16 -0
  159. blockwatch_cli-0.11.1/tests/testdata/check_lua/affects_drift.py +16 -0
  160. blockwatch_cli-0.11.1/tests/testdata/check_lua/blocking_io.lua +11 -0
  161. blockwatch_cli-0.11.1/tests/testdata/check_lua/blocking_io.py +6 -0
  162. blockwatch_cli-0.11.1/tests/testdata/check_lua/echo.lua +10 -0
  163. blockwatch_cli-0.11.1/tests/testdata/check_lua/fail.lua +3 -0
  164. blockwatch_cli-0.11.1/tests/testdata/check_lua/mode.py +6 -0
  165. blockwatch_cli-0.11.1/tests/testdata/check_lua/os.lua +10 -0
  166. blockwatch_cli-0.11.1/tests/testdata/check_lua/pathfmt/report_path.lua +4 -0
  167. blockwatch_cli-0.11.1/tests/testdata/check_lua/pathfmt/source.py +3 -0
  168. blockwatch_cli-0.11.1/tests/testdata/check_lua/pattern.py +5 -0
  169. blockwatch_cli-0.11.1/tests/testdata/check_lua/pattern_many_matches.py +6 -0
  170. blockwatch_cli-0.11.1/tests/testdata/check_lua/pattern_no_match.py +5 -0
  171. blockwatch_cli-0.11.1/tests/testdata/check_lua/success.lua +3 -0
  172. blockwatch_cli-0.11.1/tests/testdata/check_lua/success_and_failure.py +15 -0
  173. blockwatch_cli-0.11.1/tests/testdata/config/glob_target/config.toml +3 -0
  174. blockwatch_cli-0.11.1/tests/testdata/config/glob_target/package.json +3 -0
  175. blockwatch_cli-0.11.1/tests/testdata/config/glob_target/plugins/blue/package.json +3 -0
  176. blockwatch_cli-0.11.1/tests/testdata/config/glob_target/plugins/green/package.json +3 -0
  177. blockwatch_cli-0.11.1/tests/testdata/config/glob_target/plugins/red/package.json +3 -0
  178. blockwatch_cli-0.11.1/tests/testdata/general/block_selection.py +9 -0
  179. blockwatch_cli-0.11.1/tests/testdata/general/custom_file_extension.javascript +13 -0
  180. blockwatch_cli-0.11.1/tests/testdata/general/custom_file_extension.python +11 -0
  181. blockwatch_cli-0.11.1/tests/testdata/general/disable_enable.py +15 -0
  182. blockwatch_cli-0.11.1/tests/testdata/general/paths/invalid.py +4 -0
  183. blockwatch_cli-0.11.1/tests/testdata/general/paths/subdir/nested_invalid.py +4 -0
  184. blockwatch_cli-0.11.1/tests/testdata/general/paths/valid.py +4 -0
  185. blockwatch_cli-0.11.1/tests/testdata/general/severity.py +15 -0
  186. blockwatch_cli-0.11.1/tests/testdata/hidden/.github/workflows/ci.yml +3 -0
  187. blockwatch_cli-0.11.1/tests/testdata/keep_sorted/orderings.py +55 -0
  188. blockwatch_cli-0.11.1/tests/testdata/keep_unique/basic_and_pattern.py +15 -0
  189. blockwatch_cli-0.11.1/tests/testdata/line_count/equality_and_greater_than.py +17 -0
  190. blockwatch_cli-0.11.1/tests/testdata/line_pattern/forbidden_text.py +6 -0
  191. blockwatch_cli-0.11.1/tests/testdata/line_pattern/hex_and_word_patterns.py +16 -0
  192. blockwatch_cli-0.11.1/tests/testdata/list/.hg/.gitkeep +0 -0
  193. blockwatch_cli-0.11.1/tests/testdata/list/a.py +3 -0
  194. blockwatch_cli-0.11.1/tests/testdata/list/b.py +3 -0
  195. blockwatch_cli-0.11.1/tests/testdata/positions/unicode_columns.py +4 -0
  196. blockwatch_cli-0.11.1/tests/testdata/same_as/custom_ext_source.javascript +3 -0
  197. blockwatch_cli-0.11.1/tests/testdata/same_as/custom_ext_target.javascript +3 -0
  198. blockwatch_cli-0.11.1/tests/testdata/same_as/package.json +8 -0
  199. blockwatch_cli-0.11.1/tests/testdata/same_as/paths/alpha/item.txt +1 -0
  200. blockwatch_cli-0.11.1/tests/testdata/same_as/paths/beta/item.txt +1 -0
  201. blockwatch_cli-0.11.1/tests/testdata/same_as/paths_and_block_source.md +7 -0
  202. blockwatch_cli-0.11.1/tests/testdata/same_as/paths_source.md +3 -0
  203. blockwatch_cli-0.11.1/tests/testdata/same_as/sibling.rs +6 -0
  204. blockwatch_cli-0.11.1/tests/testdata/same_as/source.rs +3 -0
  205. blockwatch_cli-0.11.1/tests/testdata/same_as/split_table_source.rs +7 -0
  206. blockwatch_cli-0.11.1/tests/testdata/same_as/split_table_target.toml +9 -0
  207. blockwatch_cli-0.11.1/tests/testdata/same_as/symbol_mismatch_source.rs +3 -0
  208. blockwatch_cli-0.11.1/tests/testdata/same_as/symbol_source.rs +6 -0
  209. blockwatch_cli-0.11.1/tests/testdata/same_as/target.md +5 -0
  210. blockwatch_cli-0.11.1/tests/testdata/same_as/whole_file_mismatch_source.rs +3 -0
  211. blockwatch_cli-0.11.1/tests/testdata/same_as/whole_file_source.rs +3 -0
  212. blockwatch_cli-0.11.1/tests/testdata/same_as/whole_file_target.json +3 -0
  213. blockwatch_cli-0.11.1/tests/testdata/sarif/advisory.py +6 -0
  214. blockwatch_cli-0.11.1/tests/testdata/sarif/clean.py +6 -0
  215. blockwatch_cli-0.11.1/tests/testdata/sarif/sorted.py +6 -0
  216. blockwatch_cli-0.11.1/tests/testdata/sarif/unnamed.py +6 -0
  217. blockwatch_cli-0.11.1/tests/testdata/suppressions/commit_msg.txt +5 -0
  218. blockwatch_cli-0.11.1/tests/testdata/suppressions/commit_msg_gone_a.txt +1 -0
  219. blockwatch_cli-0.11.1/tests/testdata/suppressions/commit_msg_gone_b.txt +1 -0
  220. blockwatch_cli-0.11.1/tests/testdata/suppressions/commit_msg_lowercase_trailer.txt +1 -0
  221. blockwatch_cli-0.11.1/tests/testdata/suppressions/commit_msg_malformed.txt +1 -0
  222. blockwatch_cli-0.11.1/tests/testdata/suppressions/commit_msg_with_noise.txt +6 -0
  223. blockwatch_cli-0.11.1/tests/testdata/suppressions/dangling.py +3 -0
  224. blockwatch_cli-0.11.1/tests/testdata/suppressions/sorted.py +6 -0
  225. blockwatch_cli-0.11.1/tests/testdata/suppressions/symbol.py +4 -0
  226. blockwatch_cli-0.11.1/tests/testdata/suppressions/symbol_target.json +3 -0
  227. blockwatch_cli-0.11.1/tests/testdata/suppressions/two_rules.py +6 -0
  228. blockwatch_cli-0.11.1/tests/testdata/suppressions/unnamed.py +6 -0
  229. blockwatch_cli-0.11.1/tests/testdata/symbol_references/escapes_source.rs +12 -0
  230. blockwatch_cli-0.11.1/tests/testdata/symbol_references/escapes_target.json +7 -0
  231. blockwatch_cli-0.11.1/tests/testdata/symbol_references/filter_source.rs +4 -0
  232. blockwatch_cli-0.11.1/tests/testdata/symbol_references/filter_target.yaml +5 -0
  233. blockwatch_cli-0.11.1/tests/testdata/symbol_references/json_source.rs +3 -0
  234. blockwatch_cli-0.11.1/tests/testdata/symbol_references/json_target.json +3 -0
  235. blockwatch_cli-0.11.1/tests/testdata/symbol_references/jsonc_source.rs +3 -0
  236. blockwatch_cli-0.11.1/tests/testdata/symbol_references/jsonc_target.jsonc +4 -0
  237. blockwatch_cli-0.11.1/tests/testdata/symbol_references/mixed_list_source.rs +6 -0
  238. blockwatch_cli-0.11.1/tests/testdata/symbol_references/mixed_list_target.json +3 -0
  239. blockwatch_cli-0.11.1/tests/testdata/symbol_references/toml_source.rs +3 -0
  240. blockwatch_cli-0.11.1/tests/testdata/symbol_references/toml_target.toml +2 -0
  241. blockwatch_cli-0.11.1/tests/testdata/symbol_references/yaml_source.rs +3 -0
  242. blockwatch_cli-0.11.1/tests/testdata/symbol_references/yaml_target.yaml +2 -0
  243. blockwatch_cli-0.11.1/tests/testdata/symbol_references/yml_source.rs +3 -0
  244. blockwatch_cli-0.11.1/tests/testdata/symbol_references/yml_target.yml +2 -0
  245. blockwatch_cli-0.11.1/tests/testdata/verbosity/affects/pair.py +7 -0
  246. blockwatch_cli-0.11.1/tests/testdata/verbosity/clean/counted.py +4 -0
  247. blockwatch_cli-0.11.1/tests/testdata/verbosity/clean/noop.py +6 -0
  248. blockwatch_cli-0.11.1/tests/testdata/verbosity/clean/notes.txt +1 -0
  249. blockwatch_cli-0.11.1/tests/testdata/verbosity/clean/sorted.py +6 -0
  250. blockwatch_cli-0.11.1/tests/testdata/verbosity/diff/two_blocks.py +13 -0
  251. blockwatch_cli-0.11.1/tests/testdata/verbosity/failing/unsorted.py +6 -0
  252. blockwatch_cli-0.11.1/tests/testdata/verbosity/mixed/both_kinds.py +6 -0
  253. blockwatch_cli-0.11.1/tests/verbosity.rs +465 -0
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "blockwatch",
3
+ "displayName": "blockwatch",
4
+ "description": "Keep co-dependent code, docs, and config in sync with blockwatch <block> annotations: drift detection (affects), sorted/unique lists, regex/line-count/AI/Lua validation. Includes a skill that teaches agents when and how to add and maintain blocks.",
5
+ "author": {
6
+ "name": "Renat Mennanov",
7
+ "url": "https://github.com/mennanov"
8
+ },
9
+ "homepage": "https://github.com/mennanov/blockwatch",
10
+ "repository": "https://github.com/mennanov/blockwatch",
11
+ "license": "MIT",
12
+ "keywords": ["linter", "sync", "drift-detection", "keep-sorted", "documentation"]
13
+ }
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: blockwatch
3
+ description: Use whenever you write or change code. As you write it, add blockwatch `<block>` tags in comments, so that `blockwatch` fails when related code falls out of sync. Use `affects` for code that must change together (an enum and its docs, a constant and its config), `same-as` for two places that must hold the same value, `keep-sorted` and `keep-unique` for lists, and `line-pattern` or `line-count` for strict formats and sizes. Also use it for rules on one key of a JSON, TOML or YAML file (such as `version` in `package.json`), or on a file that must not hold tags, through `[[block]]` entries in `blockwatch.toml`, and when you edit files that hold `<block ...>` tags or that `blockwatch.toml` points at.
4
+ allowed-tools: Bash(blockwatch skill)
5
+ ---
6
+
7
+ # blockwatch skill
8
+
9
+ The `blockwatch` binary carries the full text of this skill, so the text always matches the installed version:
10
+
11
+ !`blockwatch skill`
12
+
13
+ If the text is not shown above, run `blockwatch skill` and follow what it prints. If that command fails, install or
14
+ upgrade blockwatch with `cargo install blockwatch` or `brew install mennanov/blockwatch/blockwatch`.
@@ -0,0 +1,17 @@
1
+ {
2
+ "name": "blockwatch",
3
+ "owner": {
4
+ "name": "Renat Mennanov",
5
+ "email": "mennanov@gmail.com"
6
+ },
7
+ "description": "blockwatch: a language-agnostic linter that keeps co-dependent code, docs, and config in sync via <block> annotations in comments.",
8
+ "plugins": [
9
+ {
10
+ "name": "blockwatch",
11
+ "source": "./.agents",
12
+ "description": "Skill that makes agents link co-dependent code with <block affects=...> tags, keep lists sorted/unique, and validate blocks with blockwatch.",
13
+ "category": "linting",
14
+ "tags": ["linter", "sync", "drift", "keep-sorted", "code-quality"]
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,20 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "cargo"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "monthly"
7
+ groups:
8
+ all-dependencies:
9
+ patterns:
10
+ - "*"
11
+ - package-ecosystem: "github-actions"
12
+ directory: "/"
13
+ exclude-paths:
14
+ - ".github/workflows/release.yml"
15
+ schedule:
16
+ interval: "monthly"
17
+ groups:
18
+ github-actions:
19
+ patterns:
20
+ - "*"
@@ -0,0 +1,24 @@
1
+ name: blockwatch
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ blockwatch:
14
+ runs-on: ubuntu-latest
15
+ env:
16
+ # A run is "trusted" when it is a push (which requires write access) or a pull request whose
17
+ # branch lives in this repository (i.e. not a fork). Only trusted runs receive the API key.
18
+ TRUSTED: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }}
19
+
20
+ steps:
21
+ - uses: mennanov/blockwatch-action@v1
22
+ env:
23
+ # Untrusted (fork) PRs are still linted, but without any secrets.
24
+ BLOCKWATCH_AI_API_KEY: ${{ env.TRUSTED == 'true' && secrets.BLOCKWATCH_AI_API_KEY || '' }}
@@ -0,0 +1,101 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL Advanced"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "main" ]
17
+ pull_request:
18
+ branches: [ "main" ]
19
+ schedule:
20
+ - cron: '19 9 * * 1'
21
+
22
+ jobs:
23
+ analyze:
24
+ name: Analyze (${{ matrix.language }})
25
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
26
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
27
+ # - https://gh.io/supported-runners-and-hardware-resources
28
+ # - https://gh.io/using-larger-runners (GitHub.com only)
29
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
30
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31
+ permissions:
32
+ # required for all workflows
33
+ security-events: write
34
+
35
+ # required to fetch internal or private CodeQL packs
36
+ packages: read
37
+
38
+ # only required for workflows in private repositories
39
+ actions: read
40
+ contents: read
41
+
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ include:
46
+ - language: actions
47
+ build-mode: none
48
+ - language: rust
49
+ build-mode: none
50
+ # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
51
+ # Use `c-cpp` to analyze code written in C, C++ or both
52
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58
+ steps:
59
+ - name: Checkout repository
60
+ uses: actions/checkout@v7
61
+
62
+ # Add any setup steps before running the `github/codeql-action/init` action.
63
+ # This includes steps like installing compilers or runtimes (`actions/setup-node`
64
+ # or others). This is typically only required for manual builds.
65
+ # - name: Setup runtime (example)
66
+ # uses: actions/setup-example@v1
67
+
68
+ # Initializes the CodeQL tools for scanning.
69
+ - name: Initialize CodeQL
70
+ uses: github/codeql-action/init@v4
71
+ with:
72
+ languages: ${{ matrix.language }}
73
+ build-mode: ${{ matrix.build-mode }}
74
+ # If you wish to specify custom queries, you can do so here or in a config file.
75
+ # By default, queries listed here will override any specified in a config file.
76
+ # Prefix the list here with "+" to use these queries and those in the config file.
77
+
78
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
79
+ # queries: security-extended,security-and-quality
80
+
81
+ # If the analyze step fails for one of the languages you are analyzing with
82
+ # "We were unable to automatically build your code", modify the matrix above
83
+ # to set the build mode to "manual" for that language. Then modify this step
84
+ # to build your code.
85
+ # ℹ️ Command-line programs to run using the OS shell.
86
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87
+ - name: Run manual build steps
88
+ if: matrix.build-mode == 'manual'
89
+ shell: bash
90
+ run: |
91
+ echo 'If you are using a "manual" build mode for one or more of the' \
92
+ 'languages you are analyzing, replace this with the commands to build' \
93
+ 'your code, for example:'
94
+ echo ' make bootstrap'
95
+ echo ' make release'
96
+ exit 1
97
+
98
+ - name: Perform CodeQL Analysis
99
+ uses: github/codeql-action/analyze@v4
100
+ with:
101
+ category: "/language:${{matrix.language}}"
@@ -0,0 +1,27 @@
1
+ name: markdownlint
2
+
3
+ on:
4
+ push:
5
+ branches: [ "main" ]
6
+ pull_request:
7
+ branches: [ "main" ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ markdownlint:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - uses: actions/checkout@v7
18
+ # Invoked without file arguments, the linter reads `.markdownlint-cli2.yaml` for both the
19
+ # rules and the set of files, so a pull request is judged by exactly the same configuration as
20
+ # a local commit. Unlike the hook, which sees only what is staged, this run covers every file:
21
+ # a rule added to the configuration is enforced on documents no recent change touched.
22
+ #
23
+ # The runner ships a Node capable of fetching the linter, so no toolchain setup step is needed.
24
+ - name: Lint Markdown
25
+ # <block name="markdownlint-version" same-as=".pre-commit-config.yaml:markdownlint-version" same-as-pattern="markdownlint-cli2@(?P<value>\d+\.\d+\.\d+)">
26
+ run: npx --yes markdownlint-cli2@0.23.2
27
+ # </block>
@@ -0,0 +1,80 @@
1
+ # Builds blockwatch for PyPI, as `blockwatch-cli`, and uploads it when a version tag is pushed. The pre-commit hooks
2
+ # install that package through setup.py. release.yml builds the GitHub release from the same tag.
3
+ #
4
+ # Run it by hand to build without uploading.
5
+ name: PyPI
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ on:
11
+ push:
12
+ tags:
13
+ - '**[0-9]+.[0-9]+.[0-9]+*'
14
+ workflow_dispatch:
15
+
16
+ jobs:
17
+ wheels:
18
+ strategy:
19
+ matrix:
20
+ # A platform without a wheel gets the sdist, which needs Rust to build.
21
+ # <block same-as="dist-workspace.toml#/dist/targets" same-as-pattern="\w+-(?:apple|unknown|pc)-[\w-]+">
22
+ include:
23
+ - runner: ubuntu-latest
24
+ target: x86_64-unknown-linux-gnu
25
+ - runner: ubuntu-24.04-arm
26
+ target: aarch64-unknown-linux-gnu
27
+ - runner: macos-14
28
+ target: aarch64-apple-darwin
29
+ - runner: macos-14
30
+ target: x86_64-apple-darwin
31
+ - runner: windows-latest
32
+ target: x86_64-pc-windows-msvc
33
+ # </block>
34
+ runs-on: ${{ matrix.runner }}
35
+ steps:
36
+ - uses: actions/checkout@v7
37
+ with:
38
+ persist-credentials: false
39
+ - uses: PyO3/maturin-action@v1
40
+ with:
41
+ working-directory: pypi
42
+ target: ${{ matrix.target }}
43
+ # The same glibc as the Linux binaries in the GitHub release. See dist-workspace.toml.
44
+ manylinux: 2_28
45
+ args: --out dist
46
+ - uses: actions/upload-artifact@v7
47
+ with:
48
+ name: wheel-${{ matrix.target }}
49
+ path: pypi/dist
50
+
51
+ sdist:
52
+ runs-on: ubuntu-latest
53
+ steps:
54
+ - uses: actions/checkout@v7
55
+ with:
56
+ persist-credentials: false
57
+ - uses: PyO3/maturin-action@v1
58
+ with:
59
+ working-directory: pypi
60
+ command: sdist
61
+ args: --out dist
62
+ - uses: actions/upload-artifact@v7
63
+ with:
64
+ name: sdist
65
+ path: pypi/dist
66
+
67
+ publish:
68
+ needs: [ wheels, sdist ]
69
+ if: github.event_name == 'push'
70
+ runs-on: ubuntu-latest
71
+ # PyPI accepts an upload for blockwatch-cli only from this workflow and this environment. So no token is stored.
72
+ environment: pypi
73
+ permissions:
74
+ id-token: write
75
+ steps:
76
+ - uses: actions/download-artifact@v8
77
+ with:
78
+ path: dist
79
+ merge-multiple: true
80
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,343 @@
1
+ # This file was autogenerated by dist: https://axodotdev.github.io/cargo-dist
2
+ #
3
+ # Copyright 2022-2024, axodotdev
4
+ # SPDX-License-Identifier: MIT or Apache-2.0
5
+ #
6
+ # CI that:
7
+ #
8
+ # * checks for a Git Tag that looks like a release
9
+ # * builds artifacts with dist (archives, installers, hashes)
10
+ # * uploads those artifacts to temporary workflow zip
11
+ # * on success, uploads the artifacts to a GitHub Release
12
+ #
13
+ # Note that the GitHub Release will be created with a generated
14
+ # title/body based on your changelogs.
15
+
16
+ name: Release
17
+ permissions:
18
+ "contents": "write"
19
+
20
+ # This task will run whenever you push a git tag that looks like a version
21
+ # like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
22
+ # Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
23
+ # PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
24
+ # must be a Cargo-style SemVer Version (must have at least major.minor.patch).
25
+ #
26
+ # If PACKAGE_NAME is specified, then the announcement will be for that
27
+ # package (erroring out if it doesn't have the given version or isn't dist-able).
28
+ #
29
+ # If PACKAGE_NAME isn't specified, then the announcement will be for all
30
+ # (dist-able) packages in the workspace with that version (this mode is
31
+ # intended for workspaces with only one dist-able package, or with all dist-able
32
+ # packages versioned/released in lockstep).
33
+ #
34
+ # If you push multiple tags at once, separate instances of this workflow will
35
+ # spin up, creating an independent announcement for each one. However, GitHub
36
+ # will hard limit this to 3 tags per commit, as it will assume more tags is a
37
+ # mistake.
38
+ #
39
+ # If there's a prerelease-style suffix to the version, then the release(s)
40
+ # will be marked as a prerelease.
41
+ on:
42
+ pull_request:
43
+ push:
44
+ tags:
45
+ - '**[0-9]+.[0-9]+.[0-9]+*'
46
+
47
+ jobs:
48
+ # Run 'dist plan' (or host) to determine what tasks we need to do
49
+ plan:
50
+ runs-on: "ubuntu-latest"
51
+ outputs:
52
+ val: ${{ steps.plan.outputs.manifest }}
53
+ tag: ${{ !github.event.pull_request && github.ref_name || '' }}
54
+ tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
55
+ publishing: ${{ !github.event.pull_request }}
56
+ env:
57
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58
+ steps:
59
+ - uses: actions/checkout@v7
60
+ with:
61
+ persist-credentials: false
62
+ submodules: recursive
63
+ - name: Install dist
64
+ # we specify bash to get pipefail; it guards against the `curl` command
65
+ # failing. otherwise `sh` won't catch that `curl` returned non-0
66
+ shell: bash
67
+ run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.32.0/cargo-dist-installer.sh | sh"
68
+ - name: Cache dist
69
+ uses: actions/upload-artifact@v7
70
+ with:
71
+ name: cargo-dist-cache
72
+ path: ~/.cargo/bin/dist
73
+ # sure would be cool if github gave us proper conditionals...
74
+ # so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
75
+ # functionality based on whether this is a pull_request, and whether it's from a fork.
76
+ # (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
77
+ # but also really annoying to build CI around when it needs secrets to work right.)
78
+ - id: plan
79
+ run: |
80
+ dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
81
+ echo "dist ran successfully"
82
+ cat plan-dist-manifest.json
83
+ echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
84
+ - name: "Upload dist-manifest.json"
85
+ uses: actions/upload-artifact@v7
86
+ with:
87
+ name: artifacts-plan-dist-manifest
88
+ path: plan-dist-manifest.json
89
+
90
+ # Build and packages all the platform-specific things
91
+ build-local-artifacts:
92
+ name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
93
+ # Let the initial task tell us to not run (currently very blunt)
94
+ needs:
95
+ - plan
96
+ if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
97
+ strategy:
98
+ fail-fast: false
99
+ # Target platforms/runners are computed by dist in create-release.
100
+ # Each member of the matrix has the following arguments:
101
+ #
102
+ # - runner: the github runner
103
+ # - dist-args: cli flags to pass to dist
104
+ # - install-dist: expression to run to install dist on the runner
105
+ #
106
+ # Typically there will be:
107
+ # - 1 "global" task that builds universal installers
108
+ # - N "local" tasks that build each platform's binaries and platform-specific installers
109
+ matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
110
+ runs-on: ${{ matrix.runner }}
111
+ container: ${{ matrix.container && matrix.container.image || null }}
112
+ env:
113
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114
+ BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
115
+ steps:
116
+ - name: enable windows longpaths
117
+ run: |
118
+ git config --global core.longpaths true
119
+ - uses: actions/checkout@v7
120
+ with:
121
+ persist-credentials: false
122
+ submodules: recursive
123
+ - name: Install Rust non-interactively if not already installed
124
+ if: ${{ matrix.container }}
125
+ run: |
126
+ if ! command -v cargo > /dev/null 2>&1; then
127
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
128
+ echo "$HOME/.cargo/bin" >> $GITHUB_PATH
129
+ fi
130
+ - name: Install dist
131
+ run: ${{ matrix.install_dist.run }}
132
+ # Get the dist-manifest
133
+ - name: Fetch local artifacts
134
+ uses: actions/download-artifact@v8
135
+ with:
136
+ pattern: artifacts-*
137
+ path: target/distrib/
138
+ merge-multiple: true
139
+ - name: Install dependencies
140
+ run: |
141
+ ${{ matrix.packages_install }}
142
+ - name: Build artifacts
143
+ run: |
144
+ # Actually do builds and make zips and whatnot
145
+ dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
146
+ echo "dist ran successfully"
147
+ - id: cargo-dist
148
+ name: Post-build
149
+ # We force bash here just because github makes it really hard to get values up
150
+ # to "real" actions without writing to env-vars, and writing to env-vars has
151
+ # inconsistent syntax between shell and powershell.
152
+ shell: bash
153
+ run: |
154
+ # Parse out what we just built and upload it to scratch storage
155
+ echo "paths<<EOF" >> "$GITHUB_OUTPUT"
156
+ dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
157
+ echo "EOF" >> "$GITHUB_OUTPUT"
158
+
159
+ cp dist-manifest.json "$BUILD_MANIFEST_NAME"
160
+ - name: "Upload artifacts"
161
+ uses: actions/upload-artifact@v7
162
+ with:
163
+ name: artifacts-build-local-${{ join(matrix.targets, '_') }}
164
+ path: |
165
+ ${{ steps.cargo-dist.outputs.paths }}
166
+ ${{ env.BUILD_MANIFEST_NAME }}
167
+
168
+ # Build and package all the platform-agnostic(ish) things
169
+ build-global-artifacts:
170
+ needs:
171
+ - plan
172
+ - build-local-artifacts
173
+ runs-on: "ubuntu-latest"
174
+ env:
175
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176
+ BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
177
+ steps:
178
+ - uses: actions/checkout@v7
179
+ with:
180
+ persist-credentials: false
181
+ submodules: recursive
182
+ - name: Install cached dist
183
+ uses: actions/download-artifact@v8
184
+ with:
185
+ name: cargo-dist-cache
186
+ path: ~/.cargo/bin/
187
+ - run: chmod +x ~/.cargo/bin/dist
188
+ # Get all the local artifacts for the global tasks to use (for e.g. checksums)
189
+ - name: Fetch local artifacts
190
+ uses: actions/download-artifact@v8
191
+ with:
192
+ pattern: artifacts-*
193
+ path: target/distrib/
194
+ merge-multiple: true
195
+ - id: cargo-dist
196
+ shell: bash
197
+ run: |
198
+ dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
199
+ echo "dist ran successfully"
200
+
201
+ # Parse out what we just built and upload it to scratch storage
202
+ echo "paths<<EOF" >> "$GITHUB_OUTPUT"
203
+ jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
204
+ echo "EOF" >> "$GITHUB_OUTPUT"
205
+
206
+ cp dist-manifest.json "$BUILD_MANIFEST_NAME"
207
+ - name: "Upload artifacts"
208
+ uses: actions/upload-artifact@v7
209
+ with:
210
+ name: artifacts-build-global
211
+ path: |
212
+ ${{ steps.cargo-dist.outputs.paths }}
213
+ ${{ env.BUILD_MANIFEST_NAME }}
214
+ # Determines if we should publish/announce
215
+ host:
216
+ needs:
217
+ - plan
218
+ - build-local-artifacts
219
+ - build-global-artifacts
220
+ # Only run if we're "publishing", and only if plan, local and global didn't fail (skipped is fine)
221
+ if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
222
+ env:
223
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
224
+ runs-on: "ubuntu-latest"
225
+ outputs:
226
+ val: ${{ steps.host.outputs.manifest }}
227
+ steps:
228
+ - uses: actions/checkout@v7
229
+ with:
230
+ persist-credentials: false
231
+ submodules: recursive
232
+ - name: Install cached dist
233
+ uses: actions/download-artifact@v8
234
+ with:
235
+ name: cargo-dist-cache
236
+ path: ~/.cargo/bin/
237
+ - run: chmod +x ~/.cargo/bin/dist
238
+ # Fetch artifacts from scratch-storage
239
+ - name: Fetch artifacts
240
+ uses: actions/download-artifact@v8
241
+ with:
242
+ pattern: artifacts-*
243
+ path: target/distrib/
244
+ merge-multiple: true
245
+ - id: host
246
+ shell: bash
247
+ run: |
248
+ dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
249
+ echo "artifacts uploaded and released successfully"
250
+ cat dist-manifest.json
251
+ echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
252
+ - name: "Upload dist-manifest.json"
253
+ uses: actions/upload-artifact@v7
254
+ with:
255
+ # Overwrite the previous copy
256
+ name: artifacts-dist-manifest
257
+ path: dist-manifest.json
258
+ # Create a GitHub Release while uploading all files to it
259
+ - name: "Download GitHub Artifacts"
260
+ uses: actions/download-artifact@v8
261
+ with:
262
+ pattern: artifacts-*
263
+ path: artifacts
264
+ merge-multiple: true
265
+ - name: Cleanup
266
+ run: |
267
+ # Remove the granular manifests
268
+ rm -f artifacts/*-dist-manifest.json
269
+ - name: Create GitHub Release
270
+ env:
271
+ PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
272
+ ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
273
+ ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}"
274
+ RELEASE_COMMIT: "${{ github.sha }}"
275
+ run: |
276
+ # Write and read notes from a file to avoid quoting breaking things
277
+ echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
278
+
279
+ gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
280
+
281
+ publish-homebrew-formula:
282
+ needs:
283
+ - plan
284
+ - host
285
+ runs-on: "ubuntu-latest"
286
+ env:
287
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
288
+ PLAN: ${{ needs.plan.outputs.val }}
289
+ GITHUB_USER: "axo bot"
290
+ GITHUB_EMAIL: "admin+bot@axo.dev"
291
+ if: ${{ !fromJson(needs.plan.outputs.val).announcement_is_prerelease || fromJson(needs.plan.outputs.val).publish_prereleases }}
292
+ steps:
293
+ - uses: actions/checkout@v7
294
+ with:
295
+ persist-credentials: true
296
+ repository: "mennanov/homebrew-blockwatch"
297
+ token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
298
+ # So we have access to the formula
299
+ - name: Fetch homebrew formulae
300
+ uses: actions/download-artifact@v8
301
+ with:
302
+ pattern: artifacts-*
303
+ path: Formula/
304
+ merge-multiple: true
305
+ # This is extra complex because you can make your Formula name not match your app name
306
+ # so we need to find releases with a *.rb file, and publish with that filename.
307
+ - name: Commit formula files
308
+ run: |
309
+ git config --global user.name "${GITHUB_USER}"
310
+ git config --global user.email "${GITHUB_EMAIL}"
311
+
312
+ for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
313
+ filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
314
+ name=$(echo "$filename" | sed "s/\.rb$//")
315
+ version=$(echo "$release" | jq .app_version --raw-output)
316
+
317
+ export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"
318
+ brew update
319
+ # We avoid reformatting user-provided data such as the app description and homepage.
320
+ brew style --except-cops FormulaAudit/Homepage,FormulaAudit/Desc,FormulaAuditStrict --fix "Formula/${filename}" || true
321
+
322
+ git add "Formula/${filename}"
323
+ git commit -m "${name} ${version}"
324
+ done
325
+ git push
326
+
327
+ announce:
328
+ needs:
329
+ - plan
330
+ - host
331
+ - publish-homebrew-formula
332
+ # use "always() && ..." to allow us to wait for all publish jobs while
333
+ # still allowing individual publish jobs to skip themselves (for prereleases).
334
+ # "host" however must run to completion, no skipping allowed!
335
+ if: ${{ always() && needs.host.result == 'success' && (needs.publish-homebrew-formula.result == 'skipped' || needs.publish-homebrew-formula.result == 'success') }}
336
+ runs-on: "ubuntu-latest"
337
+ env:
338
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
339
+ steps:
340
+ - uses: actions/checkout@v7
341
+ with:
342
+ persist-credentials: false
343
+ submodules: recursive