docs: publish headers match the wired reality #68
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Copyright (c) 2026 [Ribose Inc](https://www.ribose.com). | |
| # All rights reserved. | |
| # This file is a part of tamatebako | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions | |
| # are met: | |
| # 1. Redistributions of source code must retain the above copyright | |
| # notice, this list of conditions and the following disclaimer. | |
| # 2. Redistributions in binary form must reproduce the above copyright | |
| # notice, this list of conditions and the following disclaimer in the | |
| # documentation and/or other materials provided with the distribution. | |
| # | |
| # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
| # ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
| # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
| # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS | |
| # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
| # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
| # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
| # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
| # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
| # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
| # POSSIBILITY OF SUCH DAMAGE. | |
| # The lint gate: everything that can be proven WITHOUT real builds — | |
| # contract.yml against its schema + the driver-source parity arm, the | |
| # version catalog resolvable, the leg matrix computable, every authored | |
| # YAML/JSON parseable, every authored ruby file ruby -c clean, and the | |
| # spec suite green. The build legs' own gates (provenance, boot smoke) | |
| # live in _build-platform.yml. | |
| name: lint | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| # One run per branch/PR-head at a time: pushing to a branch with an open | |
| # PR would otherwise run every job twice (push + pull_request events); | |
| # a new run cancels the stale one. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }} | |
| cancel-in-progress: true | |
| jobs: | |
| lint: | |
| name: contract + catalog + matrix + parse | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0 | |
| with: | |
| ruby-version: "3.3" | |
| bundler-cache: true | |
| - name: validate contract.yml against its schema | |
| run: bundle exec scripts/check_contract.rb | |
| # The catalog resolves under the full dispatch grammar (the same | |
| # read the publish.yml plan job performs). Stdlib-only scripts — | |
| # no bundle exec needed, no gem surface. | |
| - name: resolve the version catalog | |
| run: | | |
| scripts/versions | |
| scripts/versions --filter full | |
| scripts/versions --filter tidy | |
| scripts/versions --filter "3.12.14,3.13.15" | |
| scripts/versions --pin link_unit_release | |
| # The publish.yml plan job's input: the filtered cross product must | |
| # be computable and non-empty (an unguarded empty matrix poisons a | |
| # run conclusion — the python source factory's v0.2.24-lesson note | |
| # in its release-src.yml). | |
| - name: compute the leg matrix | |
| run: | | |
| scripts/compute_matrix.rb | ruby -rjson -e ' | |
| m = JSON.parse(STDIN.read) | |
| abort "::error::empty leg matrix" if m["include"].empty? | |
| puts "#{m["include"].length} legs" | |
| ' | |
| # Every authored ruby file parses — the extensionless executables | |
| # under tools/ included (a syntax error there otherwise surfaces | |
| # only at a build leg's expense). | |
| - name: ruby -c every authored ruby file | |
| run: | | |
| set -euo pipefail | |
| { | |
| git ls-files -- '*.rb' | |
| git ls-files -- tools scripts ci | while read -r f; do | |
| head -n1 "$f" | grep -q '^#!.*ruby' && printf '%s\n' "$f" || true | |
| done | |
| } | sort -u | while read -r f; do | |
| ruby -c "$f" >/dev/null || { echo "::error::ruby -c failed: $f"; exit 1; } | |
| echo "ruby -c ok: $f" | |
| done | |
| # The spec suite (spec/): proves without real builds, exactly this | |
| # gate's charter. | |
| - name: rspec | |
| run: bundle exec rspec | |
| - name: parse every authored YAML/JSON | |
| run: | | |
| ruby -ryaml -rjson -e ' | |
| (Dir[".github/workflows/*.{yml,yaml}"] + %w[contract.yml schema/contract.schema.yml]).each do |f| | |
| YAML.load_file(f) | |
| puts "parsed #{f}" | |
| end | |
| JSON.parse(File.read(".github/matrix.json")) | |
| puts "parsed .github/matrix.json" | |
| ' |