<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Ci-Cd | Tobias Theel | Senior Software Engineer</title><link>https://blog.noobygames.de/tags/ci-cd/</link><description>Remote-first Senior Software Engineer specializing in Go, Cloud-Native architecture, and Game Development. 12+ years of experience in distributed environments.</description><generator>Hugo</generator><language>en</language><copyright>© 2026 Tobias Theel</copyright><lastBuildDate>Sun, 29 Nov 2026 08:00:00 +0100</lastBuildDate><atom:link href="https://blog.noobygames.de/tags/ci-cd/index.xml" rel="self" type="application/rss+xml"/><item><title>Building Level Time — Part 3: Release Pipeline with a Go Installer, BigWigs Packager and CurseForge</title><link>https://blog.noobygames.de/blog/level-time-3-release-pipeline/</link><pubDate>Sun, 29 Nov 2026 08:00:00 +0100</pubDate><dc:creator>Tobias Theel</dc:creator><guid isPermaLink="true">https://blog.noobygames.de/blog/level-time-3-release-pipeline/</guid><category>Software Engineering</category><category>wow-addon</category><category>lua</category><category>go</category><category>github-actions</category><category>bigwigs-packager</category><category>curseforge</category><category>release-automation</category><category>ci-cd</category><description>Push a tag, get a release: shipping a WoW addon to CurseForge with GitHub Actions and the BigWigs packager, plus a small Go installer for local builds.</description><content:encoded><![CDATA[<blockquote>
<p><strong>Series: Building Level Time</strong>, part 3 of 4. <a href="/blog/level-time-1-addon-architecture/">Part 1: Addon architecture</a> · <a href="/blog/level-time-2-testing-lua-with-go/">Part 2: Testing Lua with Go</a> · <strong>Part 3: Release pipeline</strong> · <span class="link-upcoming">Part 4: Goals and the public API</span> · Product page: <a href="/page/level-time/">Level Time</a></p>
</blockquote>
<aside class="tldr" aria-label="Key takeaways">
<p class="tldr-title">TL;DR</p>
<ul>
<li>Pushing a <code>v*</code> git tag triggers Level Time&rsquo;s GitHub Actions release workflow, and <code>needs: test</code> blocks the release whenever the test job fails.</li>
<li>The <code>BigWigsMods/packager@v2</code> action zips the addon, generates the changelog from git history and uploads to CurseForge using the <code>.toc</code> project ID and the <code>CF_API_KEY</code> secret.</li>
<li><code>.pkgmeta</code> is a deny-list, so every new non-addon file in the repository must be added to <code>ignore</code> or it ends up in the zip.</li>
<li>Level Time Goals ships from the same repository through a second packager run on a clone rewritten with <code>git filter-branch --subdirectory-filter StreamGoal</code>.</li>
<li>The Go installer in <code>tools/installer</code> copies only the files the <code>.toc</code> lists into each WoW flavor and refuses any path containing <code>WTF</code>, where SavedVariables live.</li>
</ul>

</aside>

<p>Once an addon works, it still has to reach the players, and I did not want to click through several upload forms for every version. For <a href="/page/level-time/">Level Time</a>, a World of Warcraft addon that tracks time, XP and kills per level, I wanted one rule: <strong>I push a git tag and everything else happens by itself.</strong></p>
<p>In this post I walk through the whole path from <code>git tag</code> to a file on CurseForge: the GitHub Actions workflow, the <a href="https://github.com/BigWigsMods/packager" rel="noopener">BigWigs packager</a>, the <code>.pkgmeta</code> file, the <code>.toc</code> files that serve several game clients, a trick for shipping a second addon from the same repository, and the small Go installer I use to test builds in my own WoW folders.</p>
<p>Everything here is taken from the repository&rsquo;s <code>release.yml</code>, <code>.pkgmeta</code>, <code>Makefile</code> and <code>tools/installer</code>. Comments in the repo are in German; I translated the relevant ones.</p>
<hr>
<h2 id="the-goal-a-tag-is-a-release">The goal: a tag is a release</h2>
<p>The workflow triggers on tags matching <code>v*</code>. Nothing else publishes. Regular pushes to <code>main</code> and pull requests run a separate <code>Test</code> workflow (<code>make vet</code> and <code>make test</code>), so a broken test is usually found long before I tag.</p>










<figure class="diagram">
    <div class="diagram-canvas" role="img" aria-label="From tag to release. The test job gates the release job; the packager runs twice because Level Time and Level Time Goals are separate CurseForge projects.">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 420" width="720" height="420">
  <defs>
    <marker id="ar-lt3-pipeline" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
      <path d="M0 0 L10 5 L0 10 z" class="d-arrowhead"/>
    </marker>
  </defs>

  <rect x="260" y="14" width="200" height="44" rx="9" class="d-box d-b"/>
  <text x="360" y="34" class="d-t d-bold" font-size="14" text-anchor="middle">git tag v2.26.0</text>
  <text x="360" y="50" class="d-m" font-size="11.5" text-anchor="middle">git push origin v2.26.0</text>
  <line x1="360" y1="60" x2="360" y2="80" class="d-arrow" marker-end="url(#ar-lt3-pipeline)"/>

  <rect x="220" y="84" width="280" height="44" rx="9" class="d-box"/>
  <text x="360" y="104" class="d-t d-bold" font-size="14" text-anchor="middle">Job "test"</text>
  <text x="360" y="120" class="d-m" font-size="11.5" text-anchor="middle">make test (Lua scenarios, installer, tools)</text>
  <line x1="360" y1="130" x2="360" y2="150" class="d-arrow" marker-end="url(#ar-lt3-pipeline)"/>
  <text x="372" y="144" class="d-m" font-size="11" text-anchor="start">needs: test</text>

  <rect x="220" y="154" width="280" height="44" rx="9" class="d-box"/>
  <text x="360" y="174" class="d-t d-bold" font-size="14" text-anchor="middle">Job "release"</text>
  <text x="360" y="190" class="d-m" font-size="11.5" text-anchor="middle">full git history (fetch-depth: 0)</text>

  <line x1="360" y1="200" x2="360" y2="214" class="d-arrow"/>
  <line x1="190" y1="214" x2="530" y2="214" class="d-arrow"/>
  <line x1="190" y1="214" x2="190" y2="238" class="d-arrow" marker-end="url(#ar-lt3-pipeline)"/>
  <line x1="530" y1="214" x2="530" y2="238" class="d-arrow" marker-end="url(#ar-lt3-pipeline)"/>

  <rect x="60" y="242" width="260" height="62" rx="9" class="d-box d-y"/>
  <text x="190" y="264" class="d-t d-bold" font-size="14" text-anchor="middle">Packager run 1</text>
  <text x="190" y="282" class="d-m" font-size="11.5" text-anchor="middle">repo root: LevelTimer + LevelTimer_Archive</text>
  <text x="190" y="297" class="d-m" font-size="11.5" text-anchor="middle">.pkgmeta move-folders</text>

  <rect x="400" y="242" width="260" height="62" rx="9" class="d-box d-y"/>
  <text x="530" y="264" class="d-t d-bold" font-size="14" text-anchor="middle">Packager run 2</text>
  <text x="530" y="282" class="d-m" font-size="11.5" text-anchor="middle">split clone: StreamGoal/ as root</text>
  <text x="530" y="297" class="d-m" font-size="11.5" text-anchor="middle">GITHUB_OAUTH empty (no 2nd release)</text>

  <line x1="190" y1="306" x2="190" y2="336" class="d-arrow" marker-end="url(#ar-lt3-pipeline)"/>
  <line x1="530" y1="306" x2="530" y2="336" class="d-arrow" marker-end="url(#ar-lt3-pipeline)"/>

  <rect x="40" y="340" width="300" height="58" rx="9" class="d-box d-g"/>
  <text x="190" y="362" class="d-t d-bold" font-size="13" text-anchor="middle">GitHub release + CurseForge 1721235</text>
  <text x="190" y="380" class="d-m" font-size="11.5" text-anchor="middle">Wago / WoWInterface only if ID + secret exist</text>

  <rect x="400" y="340" width="260" height="58" rx="9" class="d-box d-g"/>
  <text x="530" y="362" class="d-t d-bold" font-size="13" text-anchor="middle">CurseForge 1744370</text>
  <text x="530" y="380" class="d-m" font-size="11.5" text-anchor="middle">Level Time Goals</text>
</svg>

    </div>
    <figcaption class="diagram-caption">From tag to release. The test job gates the release job; the packager runs twice because Level Time and Level Time Goals are separate CurseForge projects.</figcaption>
</figure>

<p>The release workflow, trimmed to its skeleton:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">Release</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">on</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">push</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">tags</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="s2">&#34;v*&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">jobs</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">test</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">runs-on</span><span class="p">:</span><span class="w"> </span><span class="l">ubuntu-latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">steps</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">actions/checkout@v7</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">actions/setup-go@v7</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">with</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">go-version</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;1.27&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="l">make test</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">release</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">needs</span><span class="p">:</span><span class="w"> </span><span class="l">test         </span><span class="w"> </span><span class="c"># no green tests, no release</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">runs-on</span><span class="p">:</span><span class="w"> </span><span class="l">ubuntu-latest</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">permissions</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span><span class="nt">contents</span><span class="p">:</span><span class="w"> </span><span class="l">write   </span><span class="w"> </span><span class="c"># needed to create the GitHub release</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">steps</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">actions/checkout@v7</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">        </span><span class="nt">with</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">          </span><span class="nt">fetch-depth</span><span class="p">:</span><span class="w"> </span><span class="m">0</span><span class="w"> </span><span class="c"># the packager needs history for version and changelog</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">      </span>- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">BigWigsMods/packager@v2</span><span class="w">
</span></span></span></code></pre></div><p>Three details matter here.</p>
<p><strong><code>needs: test</code>.</strong> The release job only starts when the test job passes. The tests are the Lua scenarios I describe in <a href="/blog/level-time-2-testing-lua-with-go/">Part 2: Testing Lua with Go</a>, plus the tests of the installer and the other Go tools. A tag on a red commit therefore produces no release. See the GitHub docs on <a href="https://docs.github.com/en/actions/using-jobs/using-jobs-in-a-workflow#defining-prerequisite-jobs" rel="noopener"><code>needs</code></a>.</p>
<p><strong><code>fetch-depth: 0</code>.</strong> <code>actions/checkout</code> fetches a single commit by default. The packager derives the version from the git history and builds the changelog from commit messages, so it needs the full history and the tags.</p>
<p><strong><code>contents: write</code>.</strong> Creating a release needs write permission on repository contents. I grant it to the release job only, not to the test job. See <a href="https://docs.github.com/en/actions/tutorials/authenticate-with-github_token" rel="noopener">Automatic token authentication</a>.</p>
<hr>
<h2 id="the-bigwigs-packager">The BigWigs packager</h2>
<p>The packager is a bash script maintained by the BigWigs team and widely used in the addon ecosystem. It does a handful of jobs that are tedious by hand:</p>
<ol>
<li>Copy the addon files into a clean folder, skipping everything in the <code>ignore</code> list.</li>
<li>Replace keywords such as <code>@project-version@</code> in the files.</li>
<li>Generate a changelog from the git history.</li>
<li>Zip the result.</li>
<li>Upload to the platforms the project has configured, and create a GitHub release.</li>
</ol>
<p>The action <code>BigWigsMods/packager@v2</code> wraps the script. Which platforms it uploads to is decided by two things per platform: an ID in the <code>.toc</code> file and an API token in the environment. The workflow header documents the contract:</p>
<table>
	<thead>
			<tr>
					<th>Platform</th>
					<th><code>.toc</code> line</th>
					<th>Secret</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>CurseForge</td>
					<td><code>## X-Curse-Project-ID</code></td>
					<td><code>CF_API_KEY</code></td>
			</tr>
			<tr>
					<td>Wago</td>
					<td><code>## X-Wago-ID</code></td>
					<td><code>WAGO_API_TOKEN</code></td>
			</tr>
			<tr>
					<td>WoWInterface</td>
					<td><code>## X-WoWI-ID</code></td>
					<td><code>WOWI_API_TOKEN</code></td>
			</tr>
	</tbody>
</table>
<p>If an ID or token is missing, that platform is skipped. If everything is missing you still get the GitHub release, which is a nice property: the pipeline degrades gracefully instead of failing. Currently my <code>.toc</code> files carry a CurseForge project ID only (1721235 for Level Time, 1744370 for Level Time Goals). The tokens are repository secrets passed in as environment variables; their values never appear in the repo.</p>
<h3 id="naming-the-upload">Naming the upload</h3>
<p>By default the packager names the file after the tag, such as <code>v2.26.0</code>. I prefer the same name everywhere, so the workflow passes <code>-n</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl">- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">BigWigsMods/packager@v2</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">with</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">args</span><span class="p">:</span><span class="w"> </span>-<span class="kc">n</span><span class="w"> </span><span class="s2">&#34;{package-name}-{project-version}:{package-name}-{project-version}.zip&#34;</span><span class="w">
</span></span></span></code></pre></div><p>The format is <code>{file name}:{label}</code>. Both parts expand to <code>LevelTimer-v2.26.0</code>, so the zip and the CurseForge display name match the files from the days when I uploaded by hand. The placeholders are described in the <a href="https://github.com/BigWigsMods/packager#usage" rel="noopener">packager README</a>.</p>
<hr>
<h2 id="pkgmeta-what-goes-in-the-zip"><code>.pkgmeta</code>: what goes in the zip</h2>
<p>The packager ships the repository minus what <code>.pkgmeta</code> ignores. That is a deny-list, and that has a consequence: <strong>every new non-addon file in the repo must be added to <code>ignore</code></strong>, or it ends up in the zip. This is the full file, with the comments translated:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl"><span class="c"># Config for the BigWigs packager (.github/workflows/release.yml).</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">package-as</span><span class="p">:</span><span class="w"> </span><span class="l">LevelTimer</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="c"># Load-on-demand archive: its own addon folder next to LevelTimer/</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">move-folders</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">LevelTimer/LevelTimer_Archive</span><span class="p">:</span><span class="w"> </span><span class="l">LevelTimer_Archive</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="nt">ignore</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">tests</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">StreamGoal</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">tools</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">curseforge</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">Makefile</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">README.md</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">ROADMAP.md</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">ManualToCheck.md</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span>- <span class="l">image.png</span><span class="w">
</span></span></span></code></pre></div><p>Walking through it:</p>
<ul>
<li><strong><code>package-as</code></strong> sets the folder name inside the zip. The repository is called <code>wow-statistics</code>, but WoW expects the addon folder to match the <code>.toc</code> file name, so the folder must be <code>LevelTimer</code>.</li>
<li><strong><code>move-folders</code></strong> solves a placement problem. Level Time has a second, load-on-demand addon, <code>LevelTimer_Archive</code>, a journal archive that is only loaded when needed. WoW only sees addons that sit directly in <code>Interface/AddOns/</code>. Since the archive lives in a subfolder of the repository, the packager first puts it at <code>LevelTimer/LevelTimer_Archive/</code> and <code>move-folders</code> lifts it to the top level of the zip. The archive&rsquo;s own <code>.toc</code> carries <code>## LoadOnDemand: 1</code> and <code>## Dependencies: LevelTimer</code>.</li>
<li><strong><code>ignore</code></strong> excludes tests, Go tools, CurseForge texts and project docs. Also <code>StreamGoal</code>, which is a separate addon with its own package (next section).</li>
</ul>
<p>For the full list of directives see the <a href="https://github.com/BigWigsMods/packager/wiki/Preparing-the-PackageMeta-File" rel="noopener"><code>.pkgmeta</code> documentation</a>.</p>
<hr>
<h2 id="one-toc-several-game-clients">One <code>.toc</code>, several game clients</h2>
<p>World of Warcraft exists in several flavors: Retail, Classic Era and others. They share the addon format but not the full API. The <code>.toc</code> header of Level Time lists several interface versions in one line:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">## Interface: 120105, 11509, 20506, 16001
</span></span><span class="line"><span class="cl">## Title: Level Time
</span></span><span class="line"><span class="cl">## Version: @project-version@
</span></span><span class="line"><span class="cl">## Author: Nerzal
</span></span><span class="line"><span class="cl">## X-Curse-Project-ID: 1721235
</span></span><span class="line"><span class="cl">## SavedVariables: LevelTimerDB, LevelTimerStatsDB, LevelTimerDebugLog
</span></span></code></pre></div><p>The comma-separated <code>## Interface</code> list lets one <code>.toc</code> serve several clients, as described on the <a href="https://warcraft.wiki.gg/wiki/TOC_format" rel="noopener">TOC format page of the WoW wiki</a>. The project notes in the repo state the rule that follows from it: an API call must either exist on all listed clients or be guarded, because there is no per-flavor build. In Lua that is a plain <code>if GetPVPSessionStats then ...</code> check. The structure behind this is part of <a href="/blog/level-time-1-addon-architecture/">Part 1</a>.</p>
<p>The <code>## Version: @project-version@</code> line is the placeholder the packager replaces with the tag. The Go installer replaces the same token, so a locally installed build reports a version too.</p>
<hr>
<h2 id="two-addons-one-repository">Two addons, one repository</h2>
<p>Level Time Goals is a second addon, lives in the <code>StreamGoal/</code> folder, depends on Level Time (<code>## Dependencies: LevelTimer</code>) and has its own CurseForge project (ID 1744370). I cover how it works in <span class="link-upcoming">Part 4</span>. For the pipeline it poses a problem: the packager expects the addon to sit at the <strong>root of a git repository</strong>, and its <code>-t</code> flag even requires a <code>.git</code> there.</p>
<p>My solution is a second packager run against a throwaway clone whose root <em>is</em> <code>StreamGoal/</code>:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-yaml" data-lang="yaml"><span class="line"><span class="cl">- <span class="nt">name</span><span class="p">:</span><span class="w"> </span><span class="l">Split StreamGoal history</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">run</span><span class="p">:</span><span class="w"> </span><span class="p">|</span><span class="sd">
</span></span></span><span class="line"><span class="cl"><span class="sd">    git clone -q . sg-repo
</span></span></span><span class="line"><span class="cl"><span class="sd">    cd sg-repo
</span></span></span><span class="line"><span class="cl"><span class="sd">    git filter-branch -f --subdirectory-filter StreamGoal --tag-name-filter cat -- --all
</span></span></span><span class="line"><span class="cl"><span class="sd">    git checkout -q &#34;$GITHUB_REF_NAME&#34;</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">
</span></span></span><span class="line"><span class="cl">- <span class="nt">uses</span><span class="p">:</span><span class="w"> </span><span class="l">BigWigsMods/packager@v2</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">env</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">GITHUB_OAUTH</span><span class="p">:</span><span class="w"> </span><span class="s2">&#34;&#34;</span><span class="w">   </span><span class="c"># otherwise a second GitHub release is created for the same tag</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">  </span><span class="nt">with</span><span class="p">:</span><span class="w">
</span></span></span><span class="line"><span class="cl"><span class="w">    </span><span class="nt">args</span><span class="p">:</span><span class="w"> </span>-<span class="l">t sg-repo -n &#34;{package-name}-{project-version}:{package-name}-{project-version}.zip&#34;</span><span class="w">
</span></span></span></code></pre></div><p><a href="https://git-scm.com/docs/git-filter-branch" rel="noopener"><code>git filter-branch --subdirectory-filter</code></a> rewrites the clone so the contents of <code>StreamGoal/</code> become the repository root, and only commits that touched that folder remain. <code>--tag-name-filter cat</code> rewrites tags along with the history. A nice side effect is that the changelog for Level Time Goals then contains only commits that actually changed that addon.</p>
<p>Two caveats:</p>
<ul>
<li><code>git filter-branch</code> is flagged by Git itself as discouraged. <a href="https://github.com/newren/git-filter-repo" rel="noopener"><code>git filter-repo</code></a> is the recommended successor, but it is an extra dependency and the clone is disposable, so I have kept the built-in command so far.</li>
<li>Blanking <code>GITHUB_OAUTH</code> for the second run is deliberate. The first run already created the GitHub release for the tag; without that line the second run would try to create another one.</li>
</ul>
<p>The version token works in both runs because both <code>.toc</code> files contain <code>@project-version@</code>.</p>
<hr>
<h2 id="changelog-and-versioning">Changelog and versioning</h2>
<p>I use plain semantic-style tags: <code>v2.25.0</code>, <code>v2.25.1</code>, <code>v2.26.0</code>. Patch for fixes, minor for features. For a tag build the packager&rsquo;s project version is the tag name.</p>
<p>The changelog is generated by the packager from the git history. There is no hand-written <code>CHANGELOG.md</code> in the repository, so the quality of the release notes is the quality of my commit messages. That is a trade-off: it costs no maintenance, but it rewards disciplined commits. The listing text on CurseForge (description and logo) lives separately in the <code>curseforge/</code> folder and is edited by hand, because it describes the addon rather than a single release.</p>
<p>Local builds use the same idea: the <code>Makefile</code> computes <code>VERSION</code> with <code>git describe --tags --always --dirty</code>, so a local zip is named something like <code>LevelTimer-v2.26.0-3-gabc1234-dirty.zip</code> and cannot be confused with a real release.</p>
<hr>
<h2 id="the-go-installer">The Go installer</h2>
<p>The release pipeline covers the public path. For my own testing I need the opposite: a fast way to put the working copy into my WoW folders, for every game version I have installed. Copying by hand gets old after the third time, and an old file left behind in the addon folder can silently load stale code. So <code>tools/installer</code> is a small Go program, using only the standard library, tested with <code>go test</code> like everything else in the repository.</p>










<figure class="diagram">
    <div class="diagram-canvas" role="img" aria-label="The installer plans before it writes. The plan is a diff against what is already installed, and nothing under WTF is ever touched.">
        <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 330" width="720" height="330">
  <defs>
    <marker id="ar-lt3-installer" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="6" markerHeight="6" orient="auto-start-reverse">
      <path d="M0 0 L10 5 L0 10 z" class="d-arrowhead"/>
    </marker>
  </defs>

  <rect x="10" y="20" width="150" height="58" rx="9" class="d-box d-b"/>
  <text x="85" y="44" class="d-t d-bold" font-size="13" text-anchor="middle">Read .toc files</text>
  <text x="85" y="62" class="d-m" font-size="11.5" text-anchor="middle">file list + Media/</text>
  <line x1="162" y1="49" x2="188" y2="49" class="d-arrow" marker-end="url(#ar-lt3-installer)"/>

  <rect x="192" y="20" width="150" height="58" rx="9" class="d-box d-b"/>
  <text x="267" y="44" class="d-t d-bold" font-size="13" text-anchor="middle">Find WoW root</text>
  <text x="267" y="62" class="d-m" font-size="11.5" text-anchor="middle">-wow / WOW_DIR / scan</text>
  <line x1="344" y1="49" x2="370" y2="49" class="d-arrow" marker-end="url(#ar-lt3-installer)"/>

  <rect x="374" y="20" width="150" height="58" rx="9" class="d-box d-b"/>
  <text x="449" y="44" class="d-t d-bold" font-size="13" text-anchor="middle">Find flavors</text>
  <text x="449" y="62" class="d-m" font-size="11.5" text-anchor="middle">_retail_, _classic_era_ ...</text>
  <line x1="526" y1="49" x2="552" y2="49" class="d-arrow" marker-end="url(#ar-lt3-installer)"/>

  <rect x="556" y="20" width="154" height="58" rx="9" class="d-box d-y"/>
  <text x="633" y="44" class="d-t d-bold" font-size="13" text-anchor="middle">Build plan</text>
  <text x="633" y="62" class="d-m" font-size="11.5" text-anchor="middle">per addon and flavor</text>
  <line x1="633" y1="80" x2="633" y2="112" class="d-arrow" marker-end="url(#ar-lt3-installer)"/>

  <rect x="480" y="116" width="230" height="74" rx="9" class="d-box"/>
  <text x="595" y="138" class="d-t d-bold" font-size="13" text-anchor="middle">Compare bytes</text>
  <text x="595" y="156" class="d-m" font-size="11.5" text-anchor="middle">+ new   ~ updated   unchanged</text>
  <text x="595" y="173" class="d-m" font-size="11.5" text-anchor="middle">- stale (from old manifest)</text>
  <line x1="478" y1="153" x2="446" y2="153" class="d-arrow" marker-end="url(#ar-lt3-installer)"/>

  <rect x="226" y="116" width="216" height="74" rx="9" class="d-box"/>
  <text x="334" y="138" class="d-t d-bold" font-size="13" text-anchor="middle">Show plan, ask</text>
  <text x="334" y="156" class="d-m" font-size="11.5" text-anchor="middle">--dry-run stops here</text>
  <text x="334" y="173" class="d-m" font-size="11.5" text-anchor="middle">--yes skips the question</text>
  <line x1="224" y1="153" x2="192" y2="153" class="d-arrow" marker-end="url(#ar-lt3-installer)"/>

  <rect x="10" y="116" width="180" height="74" rx="9" class="d-box d-g"/>
  <text x="100" y="138" class="d-t d-bold" font-size="13" text-anchor="middle">Apply</text>
  <text x="100" y="156" class="d-m" font-size="11.5" text-anchor="middle">atomic writes, then</text>
  <text x="100" y="173" class="d-m" font-size="11.5" text-anchor="middle">.install-manifest.json</text>

  <rect x="10" y="236" width="700" height="62" rx="9" class="d-box d-r"/>
  <text x="360" y="260" class="d-t d-bold" font-size="13" text-anchor="middle">Hard guard: any path containing WTF is refused</text>
  <text x="360" y="280" class="d-m" font-size="12" text-anchor="middle">SavedVariables live under WTF, so the installer can never touch your settings or history</text>
</svg>

    </div>
    <figcaption class="diagram-caption">The installer plans before it writes. The plan is a diff against what is already installed, and nothing under WTF is ever touched.</figcaption>
</figure>

<p>What it does, in order:</p>
<ol>
<li><strong>Reads the file list from the <code>.toc</code>.</strong> There is one place that says which files belong to the addon (the <code>.toc</code>), plus everything under <code>Media/</code>. No second list to keep in sync. <code>LoadAddons</code> also discovers every sub-folder that contains <code>&lt;folder&gt;/&lt;folder&gt;.toc</code>, so Level Time Goals and the archive are picked up automatically.</li>
<li><strong>Finds the WoW folder.</strong> Priority: the <code>-wow</code> flag, then the <code>WOW_DIR</code> environment variable, then auto-detection. Auto-detection scans typical locations on Windows (drive letters <code>C:</code> to <code>Z:</code>, folders such as <code>World of Warcraft</code>, <code>Games\World of Warcraft</code>, <code>Program Files (x86)\World of Warcraft</code>) and macOS (<code>/Applications/World of Warcraft</code>). <strong>On Linux there is no auto-detection</strong>, so you pass <code>-wow</code> or set <code>WOW_DIR</code>.</li>
<li><strong>Finds the flavors.</strong> Every sub-folder named like <code>_retail_</code> or <code>_classic_era_</code> counts. You may even point <code>-wow</code> at a flavor folder and it steps up one level.</li>
<li><strong>Builds a plan</strong> per addon and flavor by comparing bytes: new file (<code>+</code>), changed (<code>~</code>), unchanged, or stale (<code>-</code>), meaning it was installed earlier but is no longer in the <code>.toc</code>.</li>
<li><strong>Shows the plan and asks.</strong> <code>-dry-run</code> stops here, <code>-yes</code> skips the question and by default updates the flavors that are already installed.</li>
<li><strong>Applies it.</strong> Each file is written to a temporary file and renamed, so the game never reads a half-written file. Then it writes <code>.install-manifest.json</code> into the addon folder with the version, the file list and applied migrations.</li>
</ol>
<p>The manifest is what makes stale-file cleanup safe. The installer only deletes files it knows it installed earlier. For old manual installs without a manifest it removes only code files (<code>.lua</code>, <code>.toc</code>, <code>.xml</code>) that are no longer referenced by the current <code>.toc</code>.</p>
<h3 id="the-one-rule-it-must-never-break">The one rule it must never break</h3>
<p>SavedVariables are where players&rsquo; data lives: history, settings, everything. They sit under the <code>WTF</code> folder. The installer therefore refuses any path that contains a <code>WTF</code> component, checked once for the target and again for every file it writes (<code>ensureNotConfigPath</code>, <code>safeJoin</code>). It also rejects relative paths that would escape the addon folder. A tool that overwrites your save data on a typo would be worse than no tool.</p>
<p>After an install the output tells you whether <code>/reload</code> in game is enough, or whether the client must restart because the <code>.toc</code> changed. WoW only reads <code>.toc</code> files at startup.</p>
<h3 id="using-it">Using it</h3>
<p>The <code>Makefile</code> wraps the common cases.</p>
<div class="os-tabs">
<div class="os-tab" data-label="Linux / macOS">
<p class="os-tab-label">Linux / macOS</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># Interactive wizard: choose flavors, review the plan, confirm</span>
</span></span><span class="line"><span class="cl">make install
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Update every already-installed flavor without questions</span>
</span></span><span class="line"><span class="cl">make update
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Show what would change, write nothing</span>
</span></span><span class="line"><span class="cl">make dry-run
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># Explicit WoW path (required on Linux)</span>
</span></span><span class="line"><span class="cl">make install <span class="nv">ARGS</span><span class="o">=</span><span class="s2">&#34;-flavors retail -wow &#39;</span><span class="nv">$HOME</span><span class="s2">/Games/World of Warcraft&#39;&#34;</span>
</span></span></code></pre></div>
</div>

<div class="os-tab" data-label="Windows (PowerShell)">
<p class="os-tab-label">Windows (PowerShell)</p>
<p>You can use <code>make</code> if you have it, but the Go tool itself only needs Go:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="c"># Interactive wizard from the repository root</span>
</span></span><span class="line"><span class="cl"><span class="n">go</span> <span class="n">-C</span> <span class="n">tools</span><span class="p">/</span><span class="n">installer</span> <span class="n">run</span> <span class="p">.</span> <span class="n">-src</span> <span class="s2">&#34;</span><span class="nv">$PWD</span><span class="s2">&#34;</span> <span class="n">-version</span> <span class="n">dev</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Dry run for one flavor with an explicit path</span>
</span></span><span class="line"><span class="cl"><span class="n">go</span> <span class="n">-C</span> <span class="n">tools</span><span class="p">/</span><span class="n">installer</span> <span class="n">run</span> <span class="p">.</span> <span class="n">-src</span> <span class="s2">&#34;</span><span class="nv">$PWD</span><span class="s2">&#34;</span> <span class="n">-version</span> <span class="n">dev</span> <span class="n">-dry-run</span> <span class="n">-yes</span> <span class="p">`</span>
</span></span><span class="line"><span class="cl">  <span class="n">-flavors</span> <span class="n">retail</span> <span class="n">-wow</span> <span class="s2">&#34;D:\Games\World of Warcraft&#34;</span>
</span></span></code></pre></div>
</div>

</div>

<p>To install Go see <a href="https://go.dev/doc/install" rel="noopener">go.dev/doc/install</a>. The <code>-C</code> flag of the <code>go</code> command needs Go 1.20 or newer, and CI uses Go 1.27.</p>
<p>The same program builds the manual download. <code>make package</code> runs it in <code>-package</code> mode and writes <code>dist/LevelTimer-&lt;version&gt;.zip</code> (with the archive addon inside) and <code>dist/StreamGoal-&lt;version&gt;.zip</code>. That is a handy local rehearsal of what the packager will produce, but the official release zip comes from the packager, not from this path.</p>
<p>If you are interested in how I handle Go tooling elsewhere, <a href="/blog/go-docker/">Dockerizing Go applications</a> covers a different corner of that toolbox.</p>
<hr>
<h2 id="other-go-tools-in-the-repository">Other Go tools in the repository</h2>
<p>The <code>tools/</code> folder holds more programs. A line each, because they are not part of the release path itself:</p>
<ul>
<li><strong><code>tools/addontest</code></strong> is the test harness from <a href="/blog/level-time-2-testing-lua-with-go/">Part 2</a>.</li>
<li><strong><code>tools/artwork</code></strong> draws the CurseForge logo and the in-game icon and textures (<code>make artwork</code>), so the visuals are reproducible code rather than binary files nobody can edit.</li>
<li><strong><code>tools/records</code></strong> fetches speedrun records from speedrun.com and regenerates <code>Speedrun/SpeedrunRecords.lua</code> (<code>make records</code>, needs internet).</li>
<li><strong><code>tools/flights</code></strong> reads the flight times that the addon measured itself from the SavedVariables of every flavor (read-only) and generates <code>Assist/FlightTimesData.lua</code> (<code>make flights</code>). The project notes say to run it before a release to ship the newest measurements.</li>
</ul>
<hr>
<h2 id="how-to-cut-a-release">How to cut a release</h2>
<p>The checklist I follow. Replace the version with your next one.</p>
<div class="os-tabs">
<div class="os-tab" data-label="Linux / macOS">
<p class="os-tab-label">Linux / macOS</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="c1"># 1. Be on a clean, up-to-date main</span>
</span></span><span class="line"><span class="cl">git switch main <span class="o">&amp;&amp;</span> git pull --ff-only
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># 2. Run what CI will run</span>
</span></span><span class="line"><span class="cl">make vet <span class="o">&amp;&amp;</span> make <span class="nb">test</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># 3. Tag and push the tag; this triggers the Release workflow</span>
</span></span><span class="line"><span class="cl">git tag v2.27.0
</span></span><span class="line"><span class="cl">git push origin v2.27.0
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># 4. Watch the run</span>
</span></span><span class="line"><span class="cl">gh run watch
</span></span></code></pre></div>
</div>

<div class="os-tab" data-label="Windows (PowerShell)">
<p class="os-tab-label">Windows (PowerShell)</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-powershell" data-lang="powershell"><span class="line"><span class="cl"><span class="n">git</span> <span class="k">switch</span> <span class="n">main</span><span class="p">;</span> <span class="n">git</span> <span class="n">pull</span> <span class="p">-</span><span class="n">-ff-only</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c"># Same checks as CI</span>
</span></span><span class="line"><span class="cl"><span class="n">make</span> <span class="n">vet</span><span class="p">;</span> <span class="k">if</span> <span class="p">($?)</span> <span class="p">{</span> <span class="n">make</span> <span class="n">test</span> <span class="p">}</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">git</span> <span class="n">tag</span> <span class="n">v2</span><span class="p">.</span><span class="py">27</span><span class="p">.</span><span class="py">0</span>
</span></span><span class="line"><span class="cl"><span class="n">git</span> <span class="n">push</span> <span class="n">origin</span> <span class="n">v2</span><span class="p">.</span><span class="py">27</span><span class="p">.</span><span class="py">0</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="n">gh</span> <span class="n">run</span> <span class="n">watch</span>
</span></span></code></pre></div>
</div>

</div>

<p>The <a href="https://cli.github.com/" rel="noopener">GitHub CLI</a> (<code>gh</code>) is optional; the Actions tab shows the same run. If the tests are green, the release job packages, creates the GitHub release and uploads to CurseForge. CurseForge may review a new file for a short while before it appears publicly; that part is out of my hands.</p>
<p>If a release goes wrong, there is no rollback button in the pipeline. I fix forward with a new patch tag (<code>v2.27.1</code>) instead of moving an existing tag, because moved tags confuse packager, GitHub and CurseForge alike.</p>
<hr>
<h2 id="lessons-learned">Lessons learned</h2>
<ul>
<li><strong>Make the default path the right path.</strong> One tag, one command. The fewer manual steps, the fewer forgotten ones.</li>
<li><strong>Gate releases on tests.</strong> <code>needs: test</code> costs one line.</li>
<li><strong>Allow-list or deny-list is a real decision.</strong> The packager is deny-list based. It is convenient until you forget to ignore a new file. My local <code>make package</code> is allow-list based (only what the <code>.toc</code> names) and works as a cross-check.</li>
<li><strong>Build tools that cannot hurt users, even yourself.</strong> The WTF guard in the installer exists because I know I will mistype a path one day.</li>
</ul>
<hr>
<h2 id="whats-next">What&rsquo;s next</h2>
<p>In the last part, <span class="link-upcoming">Part 4: Goals and the public API</span>, I show how Level Time Goals plugs into Level Time through an exported API and why the two addons are separate. If you want to try the result, the <a href="/page/level-time/">Level Time page</a> links to CurseForge and GitHub.</p>
]]></content:encoded></item></channel></rss>