GitHub - James Montemagno https://montemagno.com/tag/github/ https://montemagno.com/content/images/2017/08/MonogramIcon_Orange_NoBuffer.png GitHub - James Montemagno https://montemagno.com/tag/github/ Hugo -- gohugo.io Wed, 25 Nov 2026 09:25:46 GMT 60 Adding WebMCP to a Static Hugo Site on GitHub Pages https://montemagno.com/adding-webmcp-to-a-static-hugo-site-on-github-pages/ https://montemagno.com/adding-webmcp-to-a-static-hugo-site-on-github-pages/ Sat, 21 Nov 2026 15:00:00 GMT

I saw Debbie O'Brien's post about adding WebMCP to her site and thought this could be pretty cool for my own website. She also shared a walkthrough on X, which is worth checking out.

My first question, though, was whether it would work on a static website. This site uses Hugo, and GitHub Pages serves the generated files. There isn't an application server sitting behind each page waiting to answer an agent's questions.

Turns out, we don't need one!

So I added WebMCP to montemagno.com, with six read-only tools backed by a Hugo-generated content catalog. GitHub Pages still serves static files. No new backend, hosted AI model, chatbot widget, or runtime dependency.

A compatible client can now use those tools to answer questions like:

  • Which of my apps support macOS?
  • What published posts do I have about GitHub Copilot?

Here is a real Copilot CLI run discovering the tools and making those queries through a loopback relay:

Copilot CLI discovers one source and six WebMCP tools through the loopback relay, completes two webmcp_call_tool calls, and shows macOS app results linking to Tiny Clips and Weigh.
A real Copilot CLI run through the loopback relay: discovery, successful calls, and linked app results. Captured with a local test configuration.

Let's walk through what the tools do, how Hugo prepares their data, how to try them in Edge or Chrome, and a prompt for adding WebMCP to your own site.

Before you try it: WebMCP is experimental. You'll need a browser exposing the native API through its testing feature or a valid origin trial, plus a compatible client. The setup below starts with Edge.

WebMCP runs in your browser tab

WebMCP is a proposed web standard for exposing structured tools from a page. Each tool describes its purpose, defines inputs with JSON Schema, and supplies an execute function. Our JavaScript knows which content source to query and returns structured results.

That is different from hosting a conventional MCP server. Chrome's comparison explains the distinction: MCP connects clients to external systems through a protocol; WebMCP provides browser APIs for tools associated with the open page.

The page must be open, and the caller must support discovering and invoking its tools. This doesn't automatically give every chatbot or crawler access.

We used the imperative JavaScript API because our tools query existing content. WebMCP also has a declarative HTML-form API.

Two halves: build-time data, browser-time tools

The GitHub Pages hosting model fits neatly here: Hugo prepares the files at build time, GitHub Pages serves them, and JavaScript executes the tools in the browser.

Two-stage architecture: Hugo and Pagefind generate files for GitHub Pages at build time; a supported browser registers read-only tools and loads their data on demand.
The build prepares the data. The open browser tab executes the tools.

We already have the data. Hugo knows post titles, dates, tags, URLs, and descriptions. My Apps uses curated YAML, Podcasts uses show data, and Videos uses a weekly YouTube snapshot. Pagefind already indexes post text.

The integration gives callers a structured way to query those sources rather than creating a second content collection.

An app lookup, for example, filters catalog records in the tab. Full-text post search queries Pagefind's generated index instead. That split lets us reuse each source for what it already does well, rather than making the catalog a second search engine.

Build tools around the data you actually have

Debbie's implementation inspired the approach, but our six tools follow this site's content:

Tool What it returns
search-posts Pagefind-ranked published blog posts, with excerpts and matching heading links.
topic-brief Counts, first/latest publication dates, and newest highlights for posts carrying a real tag.
get-current-page Metadata, heading links, and existing eligible related posts for the open page.
list-apps Curated apps, filtered by query or platform, with website, store, and declared repository links.
list-podcasts Active or archived shows and listening links. Defaults to active shows.
list-videos Title filtering and Videos/Presentations selection from the limited weekly YouTube snapshot. Defaults to Videos.
Native Edge DevTools lists the site's six tools. Orange callouts mark the Application tab and WebMCP sidebar item.
Our six tools in the native WebMCP inspector, cropped and annotated to show where to open it.

Those scopes matter. topic-brief is a tagged-post inventory, not an AI-generated synthesis. Podcasts are shows, not episodes. Videos use the existing snapshot, not a complete archive, and don't search transcripts, chapters, or topic tags. Video responses include the sync date and source links.

Your site might only need post search and current-page context. Start with what your data can honestly answer!

Let Hugo generate the catalog

In hugo.toml, we added a custom output format:

[outputFormats.webmcp]
  mediaType = "application/json"
  baseName = "webmcp/index"
  isPlainText = true
  notAlternative = true

[outputs]
  home = ["html", "rss", "ghostrss", "webmcp"]

Keep your existing home outputs when adding the new format; this site's list includes its feeds.

Hugo uses layouts/home.webmcp.json to produce /webmcp/index.json, containing posts, pages, tags, apps, shows, and videos. Inside the eligible-page loop, this excerpt builds each page record:

{{- $description := .Description | default .Params.excerpt | default .Summary | plainify | htmlUnescape | replaceRE "\\s+" " " | strings.TrimSpace | truncate 300 -}}
{{- $record := dict "url" .Permalink "title" .Title "description" $description -}}

Posts also get publication dates, tag links, and reading time. Apps get declared platforms and links; videos get their collection and publication date.

This is metadata, not a copy of the site: no full article bodies, images, or players. Pagefind handles full-text post search.

Keep unpublished content out

Preview builds can include unpublished content, so Hugo's build settings aren't enough. The catalog and bootstrap share a webmcp-eligible.html partial that:

  • Excludes drafts, scheduled/future or expired posts, and robotsNoIndex pages.
  • Requires HTML output and excludes headless, render-excluded or unlisted pages, redirects, and 404s.
  • Omits tags without eligible public posts.

Sharing that check keeps the two halves aligned: a page excluded from the catalog doesn't gain tool registration just because we opened a draft preview. It also gives us one place to update the site's publishing rules.

Every emitted catalog record is public. Neither WebMCP nor noindex is access control. Never put private material in the snapshot and expect the browser API to hide it.

Give each tool a clear contract

In assets/js/webmcp.mjs, a shared helper adds pagination inputs, JSON Schema, runtime validation, explicit errors, and read-only annotations.

That shared contract makes another tool less work: describe its filters, choose a data source, and keep the handler focused on the query. It shouldn't need a different pagination convention or a new interpretation of what an invalid input means.

These are its schema and annotation fields, not a complete registration:

inputSchema: {
  type: 'object',
  properties,
  required,
  additionalProperties: false,
},
annotations: { readOnlyHint: true },

The helper supplies execute, checks inputs before calling tool-specific logic, and serializes failures with a code and message.

The app definition then filters the catalog. This excerpt uses that shared tool helper, the lazy catalog loader, and filtering/pagination helpers:

tool('list-apps', 'Discover the curated apps shown on My Apps, with platform, website, store and declared source links. Not every GitHub repo or a live availability check.', {
  query,
  platform: {
    type: 'string',
    enum: ['Windows', 'macOS', 'iOS', 'Android', 'Web', 'Stream Deck'],
  },
}, [], async (input, signal) => {
  const data = await catalog(signal);
  return listResponse(data.apps.filter(item =>
    matches(item, input.query) &&
    (!input.platform || item.platforms.includes(input.platform))
  ), input);
}),

The schema tells a caller what to send; runtime validation enforces it. The read-only hint describes behavior that the implementation must actually honor.

Load nothing extra for unsupported browsers

In layouts/_partials/scripts.html, eligible pages get a bootstrap that checks the native API before importing a fingerprinted module. Here it is, with the outer template guard omitted:

{{- $webmcp := resources.Get "js/webmcp.mjs" | js.Build (dict "targetPath" "js/webmcp.js" "format" "esm" "minify" true) | fingerprint }}
<script type="module">
  const api = document.modelContext;
  if (api && typeof api.registerTool === 'function') {
    import({{ $webmcp.RelPermalink | jsonify | safeJS }}).then(({ registerWebMCPTools }) =>
      registerWebMCPTools(api, {
        catalogURL: {{ "webmcp/index.json" | relURL | jsonify | safeJS }},
        pagefindURL: {{ "pagefind/pagefind.js" | relURL | jsonify | safeJS }}
      })
    ).catch(error => console.error('WebMCP registration failed', error));
  }
</script>

The Hugo expressions supply generated asset URLs. With another generator, use its asset pipeline and honor any repository base path, rather than assuming assets live at the origin root.

Unsupported browsers don't load the tool module, catalog, or Pagefind through this integration. Human-facing search can still load Pagefind independently.

In supported browsers, the catalog loads on the first tool call; Pagefind loads only for search-posts. Failed downloads can be retried.

Cropped native Network table with numbered highlights: 1 is the WebMCP module, 2 is index.json, and 3 is pagefind.js, followed by search-index requests.
1: tool module; 2: public catalog; 3: Pagefind. Captured after an app lookup and a post search. Registration alone loaded neither data source.

Read-only means no publishing, settings changes, or video playback. Cancellation stops one caller waiting without disrupting others sharing a load. If registration fails partway through, the module aborts its registration controller, removes the tools already registered, and reports the failure.

Small responses, honest pagination

Tools return JSON text with ok, plus explicit codes/messages for errors. Invalid input isn't disguised as an empty search.

Responses are capped at 4,000 serialized characters, using JavaScript string length. Lists default to five items, with a requested maximum of ten; the cap may shorten optional fields or return fewer items.

Results include:

  • hasMore: whether there is another page.
  • nextOffset: the continuation value to pass back unchanged with the same query and filters.
  • trimmed: whether optional information or the returned page was shortened to fit.

These are character limits, not measurements of tokens saved or model costs.

Cropped native list-apps result for macOS returns Tiny Clips and its links, total 3, with hasMore true, nextOffset 1, and trimmed false highlighted in orange.
One real result, with the continuation fields highlighted. Pass nextOffset back unchanged to get the next page.

Pagefind can include entries from preview builds, so search-posts checks candidates against the public catalog. It reads an extra eligible hit to determine whether more results exist without exposing a draft-inclusive raw total.

The cursor tracks search candidates, not just returned public results. Pass nextOffset back unchanged; calculating it from the item count could skip results.

Try the tools in Edge or Chrome

You can inspect the tools without an agent, then connect Copilot CLI in the next section. Use an up-to-date Microsoft Edge or Google Chrome build exposing the current native API. Edge comes first here, matching the screenshots.

Browser setup in Microsoft Edge

Microsoft's WebMCP Labs guide recommends current Canary or Dev builds, available from Edge Insider.

  1. Open edge://flags/#enable-webmcp-testing.
  2. Set WebMCP for testing to Enabled.
  3. Restart Edge when prompted.
  4. Open montemagno.com, right-click the page, and select Inspect. In DevTools, open Application, then WebMCP.

We verified this flag-and-restart workflow in Edge; the screenshots show its native inspector.

Browser setup in Google Chrome

For Chrome, follow its current WebMCP documentation:

  1. Open chrome://flags/#enable-webmcp-testing.
  2. Set WebMCP for testing to Enabled.
  3. Relaunch Chrome and open montemagno.com.

Check the API and call a tool

In either browser, run this in the page's DevTools Console:

typeof document.modelContext?.registerTool === 'function'

It should return true. Otherwise, update your browser or try a current preview build. If the API exists but no tools appear, reload and check the Console for registration errors.

On montemagno.com, discover and invoke a tool:

const tools = await document.modelContext.getTools();
const videos = tools.find(tool => tool.name === 'list-videos');
if (!videos) throw new Error('list-videos is not registered on this page');
const text = await document.modelContext.executeTool(videos, {
  collection: 'presentations',
  limit: 5,
});
const result = JSON.parse(text);
console.log(result);

executeTool receives the discovered tool object and an ordinary input object, as documented in Chrome's imperative API guide. The calls are the same in Edge and Chrome.

This is a useful first checkpoint. If discovery and execution work here, you've checked the site and browser without involving an agent or MCP bridge. Any later CLI connection problem can then be investigated as a separate layer.

Cropped native tool-discovery table lists the six names and their inputs. All six readOnly values are true in the orange-outlined column.
The native getTools() result, with the read-only annotations highlighted. No agent needed.

You can also use the Application > WebMCP inspector. Select topic-brief, enter github-copilot for topic, and inspect the input, completion status, and output.

What we checked: 83 offline gate tests passed, including WebMCP fixtures for publication rules and tool contracts. We also exercised all six tools through native Edge and checked normal search, theme switching, navigation, and lazy-network behavior.

For Copilot CLI, MCP-B's local relay is the focused option we used. It forwards a browser tab's WebMCP tools without adding a full debugging toolset.

We'll use Edge, but the same relay configuration works with Chrome. It exposes four management tools for sources, discovery, invocation, and opening pages, plus the connected site's tools.

GitHub Copilot CLI
  -> stdio -> WebMCP local relay on your machine
    -> loopback WebSocket, port 9334 -> browser adapter
      -> montemagno.com's native WebMCP tools

The tab needs a temporary browser adapter as well as the relay. This is client-side demo setup, not a website dependency or polyfill. The relay alone can't discover an arbitrary page, and this route doesn't require Chrome DevTools MCP.

1. Add the local STDIO relay

With Node.js 22 or newer and Copilot CLI installed, run its MCP configuration command:

Choose Local / STDIO in a connection-type picker. Copilot launches this process and talks through standard input/output:

copilot mcp add montemagno-webmcp -- \
  npx -y @mcp-b/webmcp-local-relay@6.2.0 \
  --port 9334 \
  --widget-origin=https://montemagno.com

Keep these connections distinct:

Connection Setting
Website open in Edge or Chrome https://montemagno.com/
Copilot CLI to the MCP relay Local / STDIO, using the command above
Browser adapter to the relay Loopback WebSocket on port 9334

Neither port 9334 nor the website is an HTTP MCP endpoint. There is no /mcp URL to enter. The relay reference documents its loopback binding; don't expose it on your network.

Restrict --widget-origin to the page's exact origin: scheme, hostname, and port if present, not the relay's address. Change it when adapting this setup to another site or development server.

Start or restart copilot, then check /mcp show montemagno-webmcp. Confirm it is connected before loading the adapter. Nothing is being installed on GitHub Pages.

2. Connect your Edge or Chrome tab

Open montemagno.com in the browser prepared above. In that page's DevTools Console, load the adapter:

const bridge = document.createElement('script');
bridge.src = 'https://cdn.jsdelivr.net/npm/@mcp-b/webmcp-local-relay@6.2.0/dist/browser/embed.js';
bridge.dataset.relayPort = '9334';
bridge.addEventListener('error', () =>
  console.error('WebMCP relay adapter failed to load')
);
document.head.append(bridge);

Keep the ports matched: --port 9334 and bridge.dataset.relayPort = '9334' must agree. If the port is occupied, choose an unused one and change both.

Review the embed documentation before loading third-party code. Both examples pin version 6.2.0. A reload, including development live reload, removes the adapter; paste it again to reconnect.

The browser may request Local Network Access permission. Review it rather than disabling protections. A site's content security policy can also block the adapter; consult the relay's troubleshooting guide.

This relay doesn't automate the browser or create a separate profile. Keep the connected page open in a dedicated demo window without private tabs or accounts.

3. Send the prompt

Try this prompt in Copilot CLI:

Use the montemagno-webmcp MCP server. Call webmcp_list_sources and
webmcp_list_tools, then select the source at https://montemagno.com/.
Use the actual relayed tool names returned by discovery to call the
site's list-apps with platform macOS and limit 2, then topic-brief
with topic github-copilot and limit 2.

Show the tool names and linked results. Use the registered WebMCP
tools, not answers inferred from scraping. If no source is connected
or a tool call fails, report the blocker instead of inventing results.

The relay converts list-apps to MCP-safe list_apps, so use the discovered names. Our run found one source and six tools, then successfully called the app and topic tools.

If you only see the four webmcp_* management tools, the relay process is available, but you still need to check its connected sources. Client tool lists don't always refresh immediately, so use the discovery calls rather than guessing whether the adapter connected.

The opening screenshot uses our local-test alias, montemagno-webmcp-local. These public-site examples use montemagno-webmcp. Keep your chosen name consistent between configuration and prompts.

Optional: automatically launch Edge or Chrome

You can skip this if you followed the relay recipe. Chrome DevTools MCP is an alternative that launches its own browser and adds broader debugging tools. It supports Edge and Chrome without the temporary adapter.

These commands are for macOS, Edge first. Use a current Node.js LTS release and a browser exposing native WebMCP.

Microsoft Edge:

copilot mcp add montemagno-edge -- \
  npx -y chrome-devtools-mcp@1.13.0 \
  --executablePath="/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge" \
  --categoryExperimentalWebmcp \
  --chromeArg=--enable-features=WebMCP \
  --isolated \
  --no-usage-statistics \
  --no-performance-crux

Google Chrome:

copilot mcp add montemagno-chrome -- \
  npx -y chrome-devtools-mcp@1.13.0 \
  --categoryExperimentalWebmcp \
  --chromeArg=--enable-features=WebMCP \
  --isolated \
  --no-usage-statistics \
  --no-performance-crux

The server auto-detects Chrome. For Edge Dev/Canary or another OS, adjust the executable path using Microsoft's guide.

The WebMCP category exposes discovery/execution tools. --chromeArg passes the feature flag to either browser; the isolated profile doesn't inherit everyday settings. The last two flags disable usage statistics and CrUX lookups.

Choose one command, start copilot, and check /mcp show montemagno-edge or /mcp show montemagno-chrome. Edge's prompt is:

Use the montemagno-edge MCP server to open https://montemagno.com/.
Call list_webmcp_tools, then use execute_webmcp_tool to call the site's
list-apps with platform macOS and limit 2. Show the linked results.
Use native WebMCP, not scraping. Report any API or bridge blocker.

For Chrome, substitute montemagno-chrome. Keep private tabs/accounts out of the demo profile and approve only intended actions; this bridge can do more than call read-only site tools.

Try this on your own static site

The takeaway isn't to copy our six tools. Choose useful read-only operations for your existing public data and make them a tested browser enhancement.

Give this prompt to a coding agent in your site's repository. It starts with an audit and approval checkpoint, not assumptions about your generator or content:

Help me evaluate and integrate WebMCP into this static website.
Start in plan mode. Inspect the repository before proposing changes.

Identify the generator, hosting/base path, build/deploy workflow, existing
search engine, public content collections, curated data, and publishing
rules. Read current official WebMCP browser/API/trial documentation.
Report useful read-only tools supported by the actual data, their exact
scope, and missing capabilities. Do not assume video tags, transcripts,
chapters, podcast episodes, or cross-content search exist. Recommend a
small tool set and wait for my approval before implementation.

After approval, reuse existing sources and search logic. Generate only
eligible public metadata at build time; exclude draft, scheduled, future,
expired, noindex, headless, render-excluded, and non-HTML content according
to this site's rules, including preview builds and draft-only taxonomy
entries. Treat every emitted file as public, not private application state.

Use the current native browser API with feature detection before loading
the tool module. Load catalogs/search lazily, preserve ordinary UX, and
avoid a backend, hosted model, chat widget, or unnecessary dependencies.
Honor the site's base path. Declare truthful schemas and read-only hints;
validate inputs at runtime; return explicit errors; support cancellation,
retryable loads, and cleanup after partial registration failure.

Choose and test a serialized response cap, bounded item limits, and
continuation that never skips or duplicates eligible records. Explain
trimming, distinguish empty results from failures, and never expose
unpublished search data or draft-inclusive totals.

Add focused offline fixtures and prove native discovery/execution in a
supported browser, not just a shim. Test unsupported-browser network
behavior, normal search/theme/navigation, and publication boundaries.
Report actual results and blockers, not invented benchmarks.

Document browser/client prerequisites and use the real public website URL
in examples. If you include an MCP bridge, specify its transport, allowed
page origins, and matching browser/server port settings. Request my
approval before deployment or changes to external services, browser trial
enrollment, or account configuration.

There you go: a static website can offer browser-side tools without becoming a server application. Start with the data you have, keep the scope honest, and make sure everyone else can keep using the same website.

]]>
More AI Agents, More CI: Reducing GitHub Actions Costs & Build Time https://montemagno.com/reducing-github-actions-costs-ai-agents/ https://montemagno.com/reducing-github-actions-costs-ai-agents/ Sat, 24 Oct 2026 19:00:00 GMT

AI coding agents are pretty awesome at helping me move projects forward. They can investigate an issue, make a change, and get a pull request ready while I am working on something else. But there is another part of that workflow that has to keep up: CI.

More agents means more branches, more pull requests, more updates to those pull requests, and more GitHub Actions jobs. Add Windows, Android, iOS, macOS, x64, and ARM64 into the mix, and one small change can turn into a whole lot of build machines doing work.

I could see it in my own usage throughout the year. The chart for my top repositories kept climbing, with a particularly noticeable jump toward the fall. That is the value of the Actions usage, not what I actually paid: much of it is included or covered by GitHub's free usage rules. Still, the growing compute footprint was a good reason to take a closer look.

Qualitative sketch of the supplied January-to-October repository usage chart. Several anonymized repository lines rise over the year, with the largest increases toward August through October. Dollar values and exact proportions are intentionally omitted; these are gross usage trends, not net billed charges.
The trend that prompted the audit. Qualitative redrawing of my top-repository usage chart, with amounts, exact proportions, and repository identities omitted. Gross usage value is not the amount billed; October is a partial month.

That was the problem I wanted to dig into across my apps. Not "how do I stop testing things?" Instead: how do I stop paying for, and waiting on, work that doesn't need to happen?

I used the GitHub Copilot app to analyze my GitHub usage export, inspect the workflows, and work through changes across repositories. Some wins were straightforward. One of the most useful discoveries was deleting caches we had just tried adding. That is right: a cache hit is not automatically a performance improvement!

The build matrix is a multiplier

Let's say an agent pushes three updates to a pull request, and each update starts four platform jobs. That is twelve jobs, before retries, release validation, or another agent working on another feature.

Parallel execution makes this easy to miss. Four five-minute jobs might finish in roughly five minutes if they start together, but they still consume about twenty runner-minutes. Queueing can make the wait longer without adding the same amount of execution time. A release waiting for approval is another thing entirely.

Those are different measurements:

Measurement What I want to learn
Runner execution time How much compute did the jobs actually use?
Pull request feedback time How long until I can act on a useful result?
Billed usage What remains chargeable after GitHub's billing rules and allowances?

The goal is to improve the right number, not just make a workflow page look shorter.

Start with the export, then follow it into the logs

My first prompt in the GitHub Copilot app was:

can you do an analysis of my actions across my repos running on windows and mac runners and see where we can optimize and cut costs

Then I attached the GitHub summarized usage CSV. My next message was simply:

Herei sm y usage report

Yes, typos and all. The useful part was supplying the data, not writing a magical prompt.

We looked at an October 1-24, 2026 snapshot containing 1,100 export records, reconciled it with GitHub's live billing API, and inspected 66 workflows across 14 repositories associated with Windows, macOS, or paid Actions usage. We also fetched 748 job records, not 748 independent workflow runs. That was complete for two paid hotspots, with selected representative runs elsewhere, not a complete performance census of every repository.

The export told us where to look. Workflow files and job logs told us what to change.

We separated setup, restore, compilation, tests, packaging, and cache transfer. We also checked whether a job really needed that operating system, whether superseded runs were still working, and whether "nothing changed" checks were allocating a native runner just to exit.

If your export includes gross usage, discounts, and net charges, keep those separate. An avoided dollar of nominal compute is not necessarily a dollar off your bill. I am deliberately not sharing my billing totals or repository-level billing breakdown here.

One more important limitation: a busy partial month is not a reliable annual forecast. It is an excellent place to find waste, though.

Put each job on the runner it actually needs

First things first: an Android build does not automatically need a Mac just because the same application also targets iOS.

For my FIRE calculator Android workflow, we moved from macos-15 to ubuntu-24.04, installed the Android-specific .NET MAUI workload, and configured the required JDK and Android SDK dependencies. We kept the required check name, tests, signing configuration, artifacts, and gates.

The hosted Android job completed in 2 minutes 35 seconds with all 447 tests passing. That confirms the Linux path worked; it is not a matched before-and-after speed benchmark. The signed AAB credential path was not exercised, and we did not dispatch a release to prove it.

Why move it? Here are the relevant GitHub standard runner list rates, checked October 24, 2026:

Runner billing SKU USD per minute Relative to Linux x64
Linux x64, 2-core $0.006 1.00x
Windows x64, 2-core $0.010 1.67x
macOS, M1 or Intel $0.062 10.33x
Published per-minute rates normalized to Linux x64 at 1: Windows x64 is 1.67 and macOS is 10.33.
Published list-rate comparison, not my bill or a hardware-performance comparison. Runner capabilities and runtimes differ.

At equal billed runtime, moving eligible work from that macOS SKU to Linux x64 reduces its nominal compute price by about 90.3%. That is a rate comparison, not a measured reduction in my total bill.

In fact, this example is a public repository: standard GitHub-hosted runners are free for public repositories. For private repositories, included allowances and discounts affect marginal savings. Larger runners have different rules and are not free just because a repository is public. GitHub also rounds each job's partial minutes up to whole minutes.

The practical lesson is still useful: keep Apple builds on a compatible Mac, Windows-specific packaging on Windows, and move portable work only after proving it works elsewhere.

Don't start an expensive machine to say "nothing changed"

Another discovery was in My Stream Timer. Its required Core test and x64/ARM64 matrix checks still needed to report results, including when a change did not affect the app.

Simply skipping an entire workflow is not a safe substitute for understanding your branch rules. Required checks can end up waiting for a result that never arrives.

Instead, we kept the check names and matrix shape. No-change checks run on Ubuntu; actual Windows work still runs on Windows.

A change detector routes unchanged app inputs to a Linux no-op required check and changed inputs to Windows builds and tests. Detection errors fail rather than reporting success.
Keep the required-check contract. Route the work, not the truth of the result.

There is a gotcha here: a failed change detector must not become a successful no-op. We checked invalid outputs, upstream failures, and cancellation as well as the happy path. Hosted Windows packages for both architectures, tests, and package validation passed. Seven live routing fixtures exercised the no-change and failure/cancellation paths.

This proves the routing behavior. We did not collect a controlled per-run latency benchmark, so I am not attaching a made-up number to it.

Cancel superseded CI, not releases

When an agent pushes a fix while the previous build is still running, do you need both ordinary CI runs to finish?

Usually, I want feedback for the newest commit. Workflow- and pull-request-scoped concurrency lets us stop spending time on an obsolete revision without having different workflows cancel each other.

Here is a small illustrative example for ordinary pull request CI, not a drop-in release policy:

on:
  pull_request:

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
  cancel-in-progress: true

We added scoped cancellation to ordinary build workflows in Tiny Clips and OutroKit. Release publishing and deployment workflows were not the target.

Cancellation cannot refund work that already ran. Its payoff depends on how often updates overlap and how much execution remains when the new commit arrives. Measure that instead of assuming every canceled run saves its full duration.

Measure the cache, including moving the cache

This was my favorite part of the investigation.

In Tiny Clips, we tried separate NuGet download caches for direct x64 builds, direct ARM64 builds, Store builds, and tests. That sounds pretty reasonable. However, downloading and unpacking a cache takes time too.

For the direct builds, warm cache-plus-restore paths were 16 seconds slower for x64 and 10 seconds slower for ARM64 than direct restore without the cache. Even the Store cache, which improved over its cold-fill path, was about seven seconds slower warm than restore alone.

We removed all three build caches.

The test cache was different:

Test dependency setup path Observed time
Restore without the cache 32 seconds
Cold cache path, including its save 44 seconds
Warm cache path, including cache overhead 21 seconds
Tiny Clips test setup took 32 seconds without a cache, 44 seconds on the cold cache path, and 21 seconds warm. Warm saved 11 seconds versus no cache.
Observed setup timings, not total workflow durations. One cold/warm pair is useful evidence, not a repeated controlled benchmark.

That is an 11-second warm setup improvement, about 34% of this setup phase. Not a 34% faster application build! The retained test cache was about 0.45 GiB, compared with roughly 3.80 GiB across the initial cache experiment.

The decision rule is pretty simple:

Compare cache lookup, download, extraction, remaining restore, and post-job save against the no-cache restore. A green "cache hit" message is not the finish line.

We kept full platform coverage. Tiny Clips validation included Windows packages for both architectures and the Store flavor, 2,388 Core test cases with zero failures and four skips, 218 passing App tests, plus 398 Mac tests and a Mac App Store build.

In OutroKit, we retained fresh restores in each job and scoped NuGet download caches by OS, architecture, and dependencies. The full Linux, Windows, Intel Mac, and Apple Silicon Mac test matrix remained. All six jobs passed, and the pack job reused the exact build cache. That establishes correctness and reuse, not a controlled speedup measurement.

Follow-up: where does the Windows cache live?

After that experiment, Awake Coding's post on Windows .NET builds and NuGet cache placement gave us another thing to measure: where NuGet reads and writes locally, not whether to download an archive from actions/cache. Those are separate decisions!

We ran four fresh GitHub-hosted Windows x64 jobs each for Tiny Clips and my file converter: two default-location jobs and two with NuGet's global packages and HTTP caches under RUNNER_TEMP. Both caches started empty; remote Actions cache transfer was off. Within each app, source, SDK, workspace, toolchain, and commands stayed the same. We tested both cache paths together, not each variable's contribution independently.

Default caches were on C:, while temporary files and the workspace were on D:. All jobs used the same Windows image, but one temporary-location job in each pilot landed on newer EPYC 9V45/NVMe hardware, versus EPYC 7763/SAS for the other three. The faster-hardware jobs are excluded below. These are independent machines in the same broad CPU/storage class, not repeated paired lab measurements.

Cold-cache pilot Default restore, two jobs Temporary-location restore, one comparable-class job Whole experimental job, default → temporary
Tiny Clips 51-56 seconds 13 seconds 227-237 → 183 seconds
File converter 53-61 seconds 10 seconds 357-368 → 259 seconds

That is a promising cold-restore signal across WinUI and MAUI! Other phases barely changed: Tiny Clips' build/package step went from 138-144 seconds to 137; the converter's compilation from 48-52 to 46. Converter workload installation stayed around 20-22 seconds and tests around 41-43. This is separate from the isolated-SDK improvement described below; that setup was unchanged between the converter arms.

All four Tiny Clips jobs passed direct x64 build and MSIX inspection; this pilot did not run tests or ARM64 builds. All four converter jobs passed the Windows app build, native x64/ARM64 checks, and 15 Bridge plus 297 Core tests, with three expected Apple-only skips per job. Neither pilot exercised Store packaging or release/signing paths. Whole-job times include provisioning and diagnostics, not a promise of production CI duration. The Tiny Clips report and converter report preserve the experiment details.

Here is an illustrative GitHub-hosted Windows step, before SDK setup, remote cache restore, or any NuGet-consuming command:

- name: Put NuGet caches under runner temp
  if: runner.os == 'Windows' && runner.environment == 'github-hosted'
  shell: pwsh
  run: |
    $packages = Join-Path $env:RUNNER_TEMP 'nuget-packages'
    $http = Join-Path $env:RUNNER_TEMP 'nuget-http'
    New-Item -ItemType Directory -Force -Path $packages, $http | Out-Null
    "NUGET_PACKAGES=$packages" >> $env:GITHUB_ENV
    "NUGET_HTTP_CACHE_PATH=$http" >> $env:GITHUB_ENV

Verify your actual paths and disks first: RUNNER_TEMP does not guarantee a faster D: drive, especially on self-hosted machines. Preserve existing deliberate local/NVMe cache placement. If you also use actions/cache, point its package path at ${{ env.NUGET_PACKAGES }} and version the key when changing the cache layout, retaining OS, architecture, and dependency scoping. Do not remotely persist the HTTP cache or credential paths.

Faster feedback is not automatically a smaller bill. The comparable Tiny Clips jobs all round up to four runner-minutes; the converter observations round from six/seven to five. These public repositories use free standard hosted compute, so neither is a measured dollar saving. These pilots did not change production workflows. Tiny Clips' retained test cache was already on D:, and the converter uses a remote package cache in production: neither warm-path benefit was measured here.

My takeaway: try local placement for cold restores, then measure the whole job and any remote transfer separately. It does not overturn the decision to remove slower remote build caches, and these pilots are not included in the cost estimate below.

Fix the environment, not just the cache

Across other cross-platform apps, Windows MAUI workload installation was an obvious hotspot: roughly six and a half to seven minutes in representative jobs.

Tempting solution? Cache the workload folders and skip installation.

Not so fast. The logs showed MSI-managed components and machine-wide Windows Installer state. Restoring a directory is not equivalent to installing that toolchain correctly. We deferred workload-folder caching rather than trade a slow reliable build for a fast mysterious one.

But that did not mean giving up on setup. In my file converter, the preinstalled SDK was reconciling unrelated Visual Studio Android, Apple, and WebAssembly workloads when we only wanted maui-windows. Instead of caching that machine-wide state, we used actions/setup-dotnet with DOTNET_INSTALL_DIR pointing to a fresh directory under runner.temp. The isolated SDK uses file-based workload installation; we still install and verify the pinned workload explicitly. No registry edits, deleting installer markers, or pretending a folder restore is an installation.

The observed Windows workload-install step went from 5 minutes 55 seconds to 20 seconds, and the whole job from 10 minutes 39 seconds to 3 minutes 48 seconds. All seven hosted checks passed, including the Windows app build and native shell checks. These are observations across workflow revisions, not a controlled benchmark attributing every second to SDK isolation; Store packaging was not dispatched.

Observed Windows timings across workflow revisions: workload installation fell from 5 minutes 55 seconds to 20 seconds; whole job duration fell from 10 minutes 39 seconds to 3 minutes 48 seconds. Installation is part of the job, not an additional saving.
Observed hosted runs, not a controlled benchmark. Workload installation is included in total job time; do not add the two reductions together. Store packaging was not exercised.

Some optimizations should stay on the drawing board

Apple pipelines had a similar lesson: a small test body can sit inside a much longer compile, install, simulator startup, and test operation. Profile the whole operation before deciding that deleting tests is the answer.

In one iOS cache experiment, the warm run avoided recompiling unchanged Swift files and cut a portable test step from about two minutes to 17 seconds. Awesome, right? Except the whole workflow went from 11 minutes 15 seconds cold to 14 minutes 53 seconds warm. Setup and native-test overhead outweighed the compilation win. One pair is not a controlled benchmark, but it certainly does not justify claiming overall savings.

We rejected that iOS cache experiment rather than keep the overhead and complexity. The final proposal keeps earlier simulator startup and disables Homebrew's automatic update/cleanup, with all 52 tests preserved. Its uncached run took 11 minutes 27 seconds, near the audit median, so I am counting zero overall savings from it. Source-built media caching in my file converter also has no verified hosted warm-hit benefit yet.

For the converter, I also explicitly chose faster automatic PR checks with full Mac proof on demand. The initial full Mac job took 9 minutes 17 seconds; compile-only checks took 3 minutes 10 seconds in one run and 4 minutes 15 seconds in the latest. Those are observational timings on differing runner images, and this is an intentional change in coverage frequency, not a cache speedup or identical work running faster. Automatic Mac compilation/static guards remain; the manual media, sandbox, and runtime proof must run for the exact release candidate before Store approval. Store signing and approval boundaries stay separate.

The media cache also correctly missed when the runner image changed. That is a safety check doing its job, not evidence of a warm-cache speedup. A reusable media cache must contain verified unsigned source-built outputs, never signing credentials or signed app bundles.

The prompts were a starting point, not the quality gate

After the analysis, my next actual prompt was:

Let's send PRs for all of these please with optimizatons

In the GitHub Copilot app, that became separate, isolated coding sessions for the repositories. Each could inspect its own workflow, make changes, and bring back a pull request and hosted CI evidence. The useful part was being able to coordinate the results: keep the good cache, remove the slower ones, preserve the required checks, and challenge optimizations that were not safe.

For a repeatable version of this process, here are suggested follow-up prompts, not quotations from my original conversation:

Analyze this GitHub Actions usage export alongside the workflows
and representative job logs. Separate runner execution time,
feedback latency, gross usage, discounts, and net billed charges.
Identify the highest-impact changes and the evidence for each.
Do not publish the raw export or private billing details.
For each proposed optimization, preserve required check names,
platform coverage, signing boundaries, and release gates unless
I explicitly approve a behavior change. Explain what can run on
Linux, what must stay native, and how failures propagate.
Measure no-cache, cold-cache, and warm-cache setup, including
lookup, transfer, extraction, restore, and post-job save time.
Remove caches that do not beat the no-cache path. Report sample
size and limitations; do not claim overall workflow speedups
from setup-only measurements.
Validate with hosted CI and report exactly what passed, what was
not exercised, and whether the PR is open or merged. Do not
dispatch a signed release just to test an optimization.

I like this approach because the agent is doing the investigation and implementation, but the acceptance criteria are still concrete. "It should be faster" is not enough.

So, how much time and money does this save?

Putting the changes together, a reasonable planning scenario is roughly 45-51% less nominal compute cost and 10-20% fewer runner-minutes for the example workload below. That combines cheaper runners, less redundant execution, and the test cache that actually helped. It is an estimate informed by our tests, not a measured reduction across my account.

Illustrative combined estimate, with the original workload indexed to 100: nominal compute cost falls to about 49-55, and runner execution time falls to about 80-90. This models runner migration, avoided redundant execution, and test setup caching; it is not measured account savings or pull request latency.
Combined planning scenario, not my actual workload or bill. Lower is better; baseline = 100. Simulator/media-cache gains, Windows SDK isolation, and on-demand Mac proof are excluded from this model.

The assumptions: 100 five-minute jobs split 40 Linux, 20 Windows, and 40 Mac; move 20 eligible Mac jobs to Linux at equal runtime, then avoid 10-20% of execution proportionally through cancellation/no-change routing, net of routing overhead. Twenty of the original Linux jobs also get the observed test-setup cache benefit, assuming 80% warm hits and including cold-cache penalties, scaled down with the avoided work. That works out to about 52-102 runner-minutes saved per 100 jobs. The job mix and avoidance rate are illustrative assumptions, not measurements of my fleet.

Actual billed savings depend on free usage, allowances, and per-job rounding, which this approximate model does not calculate. Less total execution also does not mean every PR finishes 10-20% sooner. Still, it gives us a useful target to compare with the next usage report, without counting unproven optimizations as wins!

Make the next build smarter

The big takeaway for me is not to use fewer agents or stop building cross-platform apps. It is to make the CI graph as intentional as the code those agents are changing.

Start with your usage export. Follow the expensive work into job logs. Put portable work on the right runner, stop obsolete builds, keep required checks truthful, and make caches earn their place.

Then let the agents help with the cleanup, and ask them to bring back the evidence. More pull requests do not have to mean proportionally more wasted CI.

]]>
Super Simple Git Tagging & Releases in Azure DevOps https://montemagno.com/super-simple-git-tagging-releases-in-azure-devops/ 5c13e3d958056200bf4c25ae Mon, 21 Jan 2019 16:30:00 GMT I am going to be honest with all of you, I never really understood Git tags and releases inside of GitHub. In my old TFVC days I would just create a branch with the name of the release and call that my "tag" so I could always go back to it. What sparked my interest was seeing a bunch of popular projects that I was using combine tags with the GitHub releases. I started reading the documentation and still wasn't sold on it because I have a full CI/CD pipeline setup for all of my projects and I wasn't sure how this would fit in. Then the lightbulb went off when I saw Jon Dick implement an amazing tagging scheme that would fire off a build, compile a NuGet, and then release the artifacts to NuGet automatatically...

Mind blown reaction GIF of a man miming his head exploding into outer space

Even though this was the coolest thing ever I didn't want to go changing all of my pipelines, but it did encourage me stop doing random branches for releases and streamline my tagging and releases when publishing NuGets. This is surprisingly easy to do with the new GitHub Release task. It is a very nice extension that allows you to create a tag, or re-use a tag, add a changelog file, specify release name, add artifacts, and a bunch more.

In my continuous delivery pipeline I have the following workflow:

Pipeline

My strategy here is to ensure that when I go to NuGet (beta) I create a pre-release tag and release and then when I go to full production I simply update that existing release/tag with updated information.

Uploading a Changelog

Traditionally I never uploaded anything to the drop folder except for the NuGet packages, but a nice thing with the the release task is that you can attach a changelog file (or manually enter it). Since I have a changelog file checked in to each of my repositories that I regularly update, I can just add it to the drop folder in my CI pipeline. In the Copy Files task I simply added:

**\bin\$(BuildConfiguration)\**
**\CHANGELOG.md

Adding a Pre-Release Tag & Release

After I release my pre-release package to NuGet, I want to create my very first Tag and Release. First step is to simply add the GitHub Release task:

Task

Now, it is time to fill in the information for the tag and release:

  • Select GitHub connection
  • Select GitHub repository
  • Action: Create
  • Target: $(Build.SourceVersion)
  • Tag Source: User Specified Tag (if you want to you can have it use an existing tag)
  • Tag: v$(Build.BuildNumber)
  • Release Title: v$(Build.BuildNumber)
  • Release note source: Release notes file
  • Release notes file path: $(System.DefaultWorkingDirectory)/**/CHANGELOG.md
  • Assets:
$(System.DefaultWorkingDirectory)/**/drop/beta-public/*.nupkg
  • Options: Pre-release & Add changelog

Editing a Release

Now, when I go into my final phase to publish my packages to stable on NuGet I want to modify the release I just created. You could optionally create a new release and different tag, but this makes no sense to me currently (leave comments below to let me know what you think).

You can simply add the same exact Task and instead of specifying Create for the Action specify Edit. You will fill in all of the same information except at the end:

  • Assets: Instead of beta-public folder, I change it to public
  • Replace existing assets
  • Uncheck pre-release

And just like that you will have beautiful releases automatically when you publich to NuGet in pre-release or stable:

Capture

]]>