<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>doc_internal/mac-artifacts.md - fork/fish-shell @ master</title>
<meta name="description" content="doc_internal/mac-artifacts.md in fork/fish-shell at master.">
<meta property="og:title" content="doc_internal/mac-artifacts.md - fork/fish-shell @ master">
<meta property="og:description" content="doc_internal/mac-artifacts.md in fork/fish-shell at master.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="master" data-tip="605c466379a074cf1b5cdb2b62bc8071aab8b47b">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/fish-shell</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/fish-shell</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Johannes Altmanninger</span><span class="commit-message" data-commit="6056b54ddb7018c455385690ce84c23a90724d36">Rename build_tools/make_pkg.sh</span><span class="snapshot-sha sha" data-commit="6056b54ddb7018c455385690ce84c23a90724d36">6056b54dd</span><time datetime="2024-04-14T20:53:26+02:00" title="2024-04-14 20:53:26 +0200">2024-04-14</time></p>
<header class="topbar"><details class="switcher"><summary>master</summary><div class="menu"><strong>branches</strong><a class="current" href="/fork/fish-shell/ref/master/">master</a><a class="all" href="/fork/fish-shell/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/fish-shell/">fish-shell</a> / <a href="/fork/fish-shell/ref/master/tree/doc_internal/">doc_internal</a> / <span class="cur">mac-artifacts.md</span></nav>
<span class="view-stats"><span>2.3 KiB</span><span>54 lines</span></span><span class="actions"><a class="raw" href="/fork/fish-shell/raw/1494b2aa45c3283c5a7cccdf0d8231ee60dce839/doc_internal/mac-artifacts.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>Building macOS Artifacts</h1>
<p>This describes how to build macOS artifacts as part of a release. These artifacts are uploaded to the GitHub release page, where they are discovered by the web site build script.</p>
<p>Artifacts may be built locally or in CI. Using CI is preferred.</p>
<blockquote>
<p><strong>Note</strong>
Only fish-shell administrations may create releases. Released macOS packages require code signing and notarization via private Apple developer keys, which are owned by @ridiculous_fish. These keys are stored in GitHub secrets.</p>
</blockquote>
<h2>Building in CI (GitHub Actions)</h2>
<p>macOS packages may be built in CI through a GitHub workflow. This requires a fish-shell administrator as it requires invoking secret code signing keys.</p>
<p>Steps:</p>
<ol>
<li>Go to https://github.com/fish-shell/fish-shell/actions</li>
<li>On the left side, click on the "macOS build and codesign" Action.</li>
<li>On the right, click on the "Run workflow" button, select the branch or tag, and click Run Workflow.</li>
<li><strong>Reload the page</strong>. This is necessary because the workflow will not appear until the page is reloaded.</li>
<li>Click on the new workflow. It should be in a Waiting state.</li>
<li>Click on Review Deployments, and approve and start the "deployment."</li>
<li>Once the workflow completes, expand the <code>actions/upload-artifact@v4</code> step in the logs. This should have an "Artifact download URL" - click it and download!</li>
</ol>
<h2>Building locally (no code signing)</h2>
<p>To build locally without notarizing and code signing, use the <code>build_tools/make_macos_pkg.sh</code> script:</p>
<pre>&gt; ./build_tools/make_macos_pkg.sh
</pre>
<p>Packages will be placed in <code>~/fish_built</code> by default.</p>
<p>Note these packages will result in loud warnings or errors when others try to install them, because of the lack of code signing.</p>
<h2>Building locally with code signing and notarization</h2>
<p>You will need the following:</p>
<ul>
<li>The ".p12" certificate files for both "Developer ID Application" and "Developer ID Installer".
<ul>
<li>(These can be generated via Export Certificate in Xcode)</li>
</ul>
</li>
<li>The password for these files (by convention, the same password is used for both).</li>
<li>The JSON file generated via <code>rcodesign encode-app-store-connect-api-key</code>.</li>
</ul>
<p>An example run:</p>
<pre>&gt; ./build_tools/make_macos_pkg.sh -s \
    -f fish-developer-id-application.p12 \
    -i fish-developer-id-installer.p12 \
    -p &quot;$NOTARIZE_PASSWORD&quot;  \
    -n \
    -j notarize-data.json
</pre>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>Building macOS Artifacts</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">This describes how to build macOS artifacts as part of a release. These artifacts are uploaded to the GitHub release page, where they are discovered by the web site build script.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">Artifacts may be built locally or in CI. Using CI is preferred.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"><a-p>&gt; </a-p>**Note**</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"><a-p>&gt; </a-p>Only fish-shell administrations may create releases. Released macOS packages require code signing and notarization via private Apple developer keys, which are owned by @ridiculous_fish. These keys are stored in GitHub secrets.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"><a-p>##</a-p> <a-tt>Building in CI (GitHub Actions)</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text">macOS packages may be built in CI through a GitHub workflow. This requires a fish-shell administrator as it requires invoking secret code signing keys.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text">Steps:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"><a-p>1. </a-p>Go to https://github.com/fish-shell/fish-shell/actions</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>2. </a-p>On the left side, click on the &quot;macOS build and codesign&quot; Action.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"><a-p>3. </a-p>On the right, click on the &quot;Run workflow&quot; button, select the branch or tag, and click Run Workflow.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>4. </a-p>**Reload the page**. This is necessary because the workflow will not appear until the page is reloaded.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"><a-p>5. </a-p>Click on the new workflow. It should be in a Waiting state.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>6. </a-p>Click on Review Deployments, and approve and start the &quot;deployment.&quot;</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"><a-p>7. </a-p>Once the workflow completes, expand the `actions/upload-artifact@v4` step in the logs. This should have an &quot;Artifact download URL&quot; - click it and download!</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"><a-p>## </a-p><a-tt>Building locally (no code signing)</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>To build locally without notarizing and code signing, use the `build_tools/make_macos_pkg.sh` script:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>&gt; ./build_tools/make_macos_pkg.sh</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"><a-p>Packages will be placed in `~/fish_built` by default.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"><a-p>Note these packages will result in loud warnings or errors when others try to install them, because of the lack of code signing.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"><a-p>## </a-p><a-tt>Building locally with code signing and notarization</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"><a-p>You will need the following:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text"><a-p>-   The &quot;.p12&quot; certificate files for both &quot;Developer ID Application&quot; and &quot;Developer ID Installer&quot;.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L41" href="#L41">41</a><span class="code-text"><a-p>    -   (These can be generated via Export Certificate in Xcode)</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text"><a-p>-   The password for these files (by convention, the same password is used for both).</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"><a-p>-   The JSON file generated via `rcodesign encode-app-store-connect-api-key`.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text"><a-p>An example run:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text"><a-p>&gt; ./build_tools/make_macos_pkg.sh -s \</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text"><a-p>    -f fish-developer-id-application.p12 \</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text"><a-p>    -i fish-developer-id-installer.p12 \</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"><a-p>    -p &quot;$NOTARIZE_PASSWORD&quot;  \</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text"><a-p>    -n \</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text"><a-p>    -j notarize-data.json</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"><a-p>```</a-p></span></span></pre></div></div>
</main>
</body>
</html>
