mirror of
https://github.com/coder/coder.git
synced 2026-06-02 20:48:20 +00:00
3f13859ade
Bumps the github-actions group with 4 updates: [step-security/harden-runner](https://github.com/step-security/harden-runner), [actions/cache](https://github.com/actions/cache), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/download-artifact](https://github.com/actions/download-artifact). Updates `step-security/harden-runner` from 2.13.2 to 2.14.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/step-security/harden-runner/releases">step-security/harden-runner's releases</a>.</em></p> <blockquote> <h2>v2.14.0</h2> <h2>What's Changed</h2> <ul> <li>Selective installation: Harden-Runner now skips installation on GitHub-hosted runners when the repository has a custom property skip_harden_runner, allowing organizations to opt out specific repos.</li> <li>Avoid double install: The action no longer installs Harden-Runner if it’s already present on a GitHub-hosted runner, which could happen when a composite action also installs it.</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/step-security/harden-runner/compare/v2.13.3...v2.14.0">https://github.com/step-security/harden-runner/compare/v2.13.3...v2.14.0</a></p> <h2>v2.13.3</h2> <h2>What's Changed</h2> <ul> <li>Fixed an issue where process events were not uploaded in certain edge cases.</li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/step-security/harden-runner/compare/v2.13.2...v2.13.3">https://github.com/step-security/harden-runner/compare/v2.13.2...v2.13.3</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/step-security/harden-runner/commit/20cf305ff2072d973412fa9b1e3a4f227bda3c76"><code>20cf305</code></a> Merge pull request <a href="https://redirect.github.com/step-security/harden-runner/issues/622">#622</a> from step-security/feature/custom-property-skip</li> <li><a href="https://github.com/step-security/harden-runner/commit/c51e8eeb6c4fdcd08f65e43a051dacdbfaa69702"><code>c51e8ee</code></a> feat: skip agent install and post step on subsequent runs for GitHub-hosted r...</li> <li><a href="https://github.com/step-security/harden-runner/commit/e152b90204c3d85cefa1441b701a47a13ed28bd7"><code>e152b90</code></a> feat: skip harden-runner based on repository custom property</li> <li><a href="https://github.com/step-security/harden-runner/commit/ee1faec052d1000061fa79a13e030db11b3f86bd"><code>ee1faec</code></a> feat: replace skip-harden-runner with skip-on-custom-property input</li> <li><a href="https://github.com/step-security/harden-runner/commit/1dc7c1764659d537dab2a854b8e165a801103eb1"><code>1dc7c17</code></a> feat: add skip-harden-runner input to conditionally skip execution</li> <li><a href="https://github.com/step-security/harden-runner/commit/df199fb7be9f65074067a9eb93f12bb4c5547cf2"><code>df199fb</code></a> Merge pull request <a href="https://redirect.github.com/step-security/harden-runner/issues/620">#620</a> from step-security/rc-29</li> <li><a href="https://github.com/step-security/harden-runner/commit/03d096a772368b1f0222005a6899d3e35a7f62df"><code>03d096a</code></a> update agent</li> <li><a href="https://github.com/step-security/harden-runner/commit/40901073af04afd40408833437092a7467798f33"><code>4090107</code></a> fix: update agent</li> <li>See full diff in <a href="https://github.com/step-security/harden-runner/compare/95d9a5deda9de15063e7595e9719c11c38c90ae2...20cf305ff2072d973412fa9b1e3a4f227bda3c76">compare view</a></li> </ul> </details> <br /> Updates `actions/cache` from 4.3.0 to 5.0.1 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/cache/releases">actions/cache's releases</a>.</em></p> <blockquote> <h2>v5.0.1</h2> <blockquote> <p>[!IMPORTANT] <strong><code>actions/cache@v5</code> runs on the Node.js 24 runtime and requires a minimum Actions Runner version of <code>2.327.1</code>.</strong></p> <p>If you are using self-hosted runners, ensure they are updated before upgrading.</p> </blockquote> <hr /> <h1>v5.0.1</h1> <h2>What's Changed</h2> <ul> <li>fix: update <code>@actions/cache</code> for Node.js 24 punycode deprecation by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/cache/pull/1685">actions/cache#1685</a></li> <li>prepare release v5.0.1 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/cache/pull/1686">actions/cache#1686</a></li> </ul> <h1>v5.0.0</h1> <h2>What's Changed</h2> <ul> <li>Upgrade to use node24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/cache/pull/1630">actions/cache#1630</a></li> <li>Prepare v5.0.0 release by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/cache/pull/1684">actions/cache#1684</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/cache/compare/v5...v5.0.1">https://github.com/actions/cache/compare/v5...v5.0.1</a></p> <h2>v5.0.0</h2> <blockquote> <p>[!IMPORTANT] <strong><code>actions/cache@v5</code> runs on the Node.js 24 runtime and requires a minimum Actions Runner version of <code>2.327.1</code>.</strong></p> <p>If you are using self-hosted runners, ensure they are updated before upgrading.</p> </blockquote> <hr /> <h2>What's Changed</h2> <ul> <li>Upgrade to use node24 by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/cache/pull/1630">actions/cache#1630</a></li> <li>Prepare v5.0.0 release by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/cache/pull/1684">actions/cache#1684</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/cache/compare/v4.3.0...v5.0.0">https://github.com/actions/cache/compare/v4.3.0...v5.0.0</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/actions/cache/blob/main/RELEASES.md">actions/cache's changelog</a>.</em></p> <blockquote> <h1>Releases</h1> <h2>Changelog</h2> <h3>5.0.1</h3> <ul> <li>Update <code>@azure/storage-blob</code> to <code>^12.29.1</code> via <code>@actions/cache@5.0.1</code> <a href="https://redirect.github.com/actions/cache/pull/1685">#1685</a></li> </ul> <h3>5.0.0</h3> <blockquote> <p>[!IMPORTANT] <code>actions/cache@v5</code> runs on the Node.js 24 runtime and requires a minimum Actions Runner version of <code>2.327.1</code>. If you are using self-hosted runners, ensure they are updated before upgrading.</p> </blockquote> <h3>4.3.0</h3> <ul> <li>Bump <code>@actions/cache</code> to <a href="https://redirect.github.com/actions/toolkit/pull/2132">v4.1.0</a></li> </ul> <h3>4.2.4</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.5</li> </ul> <h3>4.2.3</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.3 (obfuscates SAS token in debug logs for cache entries)</li> </ul> <h3>4.2.2</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.2</li> </ul> <h3>4.2.1</h3> <ul> <li>Bump <code>@actions/cache</code> to v4.0.1</li> </ul> <h3>4.2.0</h3> <p>TLDR; The cache backend service has been rewritten from the ground up for improved performance and reliability. <a href="https://github.com/actions/cache">actions/cache</a> now integrates with the new cache service (v2) APIs.</p> <p>The new service will gradually roll out as of <strong>February 1st, 2025</strong>. The legacy service will also be sunset on the same date. Changes in these release are <strong>fully backward compatible</strong>.</p> <p><strong>We are deprecating some versions of this action</strong>. We recommend upgrading to version <code>v4</code> or <code>v3</code> as soon as possible before <strong>February 1st, 2025.</strong> (Upgrade instructions below).</p> <p>If you are using pinned SHAs, please use the SHAs of versions <code>v4.2.0</code> or <code>v3.4.0</code></p> <p>If you do not upgrade, all workflow runs using any of the deprecated <a href="https://github.com/actions/cache">actions/cache</a> will fail.</p> <p>Upgrading to the recommended versions will not break your workflows.</p> <h3>4.1.2</h3> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/cache/commit/9255dc7a253b0ccc959486e2bca901246202afeb"><code>9255dc7</code></a> Merge pull request <a href="https://redirect.github.com/actions/cache/issues/1686">#1686</a> from actions/cache-v5.0.1-release</li> <li><a href="https://github.com/actions/cache/commit/8ff5423e8b66eacab4e638ee52abbd2cb831366a"><code>8ff5423</code></a> chore: release v5.0.1</li> <li><a href="https://github.com/actions/cache/commit/9233019a152bc768059ac1768b8e4403b5da16c1"><code>9233019</code></a> Merge pull request <a href="https://redirect.github.com/actions/cache/issues/1685">#1685</a> from salmanmkc/node24-storage-blob-fix</li> <li><a href="https://github.com/actions/cache/commit/b975f2bb844529e1063ad882c609b224bcd66eb6"><code>b975f2b</code></a> fix: add peer property to package-lock.json for dependencies</li> <li><a href="https://github.com/actions/cache/commit/d0a0e1813491d01d574c95f8d189f62622bbb2ae"><code>d0a0e18</code></a> fix: update license files for <code>@actions/cache</code>, fast-xml-parser, and strnum</li> <li><a href="https://github.com/actions/cache/commit/74de208dcfcbe85c0e7154e7b17e4105fe2554ff"><code>74de208</code></a> fix: update <code>@actions/cache</code> to ^5.0.1 for Node.js 24 punycode fix</li> <li><a href="https://github.com/actions/cache/commit/ac7f1152ead02e89c14b5456d14ab17591e74cfb"><code>ac7f115</code></a> peer</li> <li><a href="https://github.com/actions/cache/commit/b0f846b50b6061d7a2ca6f1a2fea61d4a65d1a16"><code>b0f846b</code></a> fix: update <code>@actions/cache</code> with storage-blob fix for Node.js 24 punycode depr...</li> <li><a href="https://github.com/actions/cache/commit/a7833574556fa59680c1b7cb190c1735db73ebf0"><code>a783357</code></a> Merge pull request <a href="https://redirect.github.com/actions/cache/issues/1684">#1684</a> from actions/prepare-cache-v5-release</li> <li><a href="https://github.com/actions/cache/commit/3bb0d78750a39cefce0c2b5a0a9801052b4359ad"><code>3bb0d78</code></a> docs: highlight v5 runner requirement in releases</li> <li>Additional commits viewable in <a href="https://github.com/actions/cache/compare/0057852bfaa89a56745cba8c7296529d2fc39830...9255dc7a253b0ccc959486e2bca901246202afeb">compare view</a></li> </ul> </details> <br /> Updates `actions/upload-artifact` from 5.0.0 to 6.0.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/upload-artifact/releases">actions/upload-artifact's releases</a>.</em></p> <blockquote> <h2>v6.0.0</h2> <h2>v6 - What's new</h2> <blockquote> <p>[!IMPORTANT] actions/upload-artifact@v6 now runs on Node.js 24 (<code>runs.using: node24</code>) and requires a minimum Actions Runner version of 2.327.1. If you are using self-hosted runners, ensure they are updated before upgrading.</p> </blockquote> <h3>Node.js 24</h3> <p>This release updates the runtime to Node.js 24. v5 had preliminary support for Node.js 24, however this action was by default still running on Node.js 20. Now this action by default will run on Node.js 24.</p> <h2>What's Changed</h2> <ul> <li>Upload Artifact Node 24 support by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/719">actions/upload-artifact#719</a></li> <li>fix: update <code>@actions/artifact</code> for Node.js 24 punycode deprecation by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/744">actions/upload-artifact#744</a></li> <li>prepare release v6.0.0 for Node.js 24 support by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/745">actions/upload-artifact#745</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v5.0.0...v6.0.0">https://github.com/actions/upload-artifact/compare/v5.0.0...v6.0.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/upload-artifact/commit/b7c566a772e6b6bfb58ed0dc250532a479d7789f"><code>b7c566a</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/745">#745</a> from actions/upload-artifact-v6-release</li> <li><a href="https://github.com/actions/upload-artifact/commit/e516bc8500aaf3d07d591fcd4ae6ab5f9c391d5b"><code>e516bc8</code></a> docs: correct description of Node.js 24 support in README</li> <li><a href="https://github.com/actions/upload-artifact/commit/ddc45ed9bca9b38dbd643978d88e3981cdc91415"><code>ddc45ed</code></a> docs: update README to correct action name for Node.js 24 support</li> <li><a href="https://github.com/actions/upload-artifact/commit/615b319bd27bb32c3d64dca6b6ed6974d5fbe653"><code>615b319</code></a> chore: release v6.0.0 for Node.js 24 support</li> <li><a href="https://github.com/actions/upload-artifact/commit/017748b48f8610ca8e6af1222f4a618e84a9c703"><code>017748b</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/744">#744</a> from actions/fix-storage-blob</li> <li><a href="https://github.com/actions/upload-artifact/commit/38d4c7997f5510fcc41fc4aae2a6b97becdbe7fc"><code>38d4c79</code></a> chore: rebuild dist</li> <li><a href="https://github.com/actions/upload-artifact/commit/7d27270e0cfd253e666c44abac0711308d2d042f"><code>7d27270</code></a> chore: add missing license cache files for <code>@actions/core</code>, <code>@actions/io</code>, and mi...</li> <li><a href="https://github.com/actions/upload-artifact/commit/5f643d3c9475505ccaf26d686ffbfb71a8387261"><code>5f643d3</code></a> chore: update license files for <code>@actions/artifact</code><a href="https://github.com/5"><code>@5</code></a>.0.1 dependencies</li> <li><a href="https://github.com/actions/upload-artifact/commit/1df1684032c88614064493e1a0478fcb3583e1d0"><code>1df1684</code></a> chore: update package-lock.json with <code>@actions/artifact</code><a href="https://github.com/5"><code>@5</code></a>.0.1</li> <li><a href="https://github.com/actions/upload-artifact/commit/b5b1a918401ee270935b6b1d857ae66c85f3be6f"><code>b5b1a91</code></a> fix: update <code>@actions/artifact</code> to ^5.0.0 for Node.js 24 punycode fix</li> <li>Additional commits viewable in <a href="https://github.com/actions/upload-artifact/compare/330a01c490aca151604b8cf639adc76d48f6c5d4...b7c566a772e6b6bfb58ed0dc250532a479d7789f">compare view</a></li> </ul> </details> <br /> Updates `actions/download-artifact` from 6.0.0 to 7.0.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/download-artifact/releases">actions/download-artifact's releases</a>.</em></p> <blockquote> <h2>v7.0.0</h2> <h2>v7 - What's new</h2> <blockquote> <p>[!IMPORTANT] actions/download-artifact@v7 now runs on Node.js 24 (<code>runs.using: node24</code>) and requires a minimum Actions Runner version of 2.327.1. If you are using self-hosted runners, ensure they are updated before upgrading.</p> </blockquote> <h3>Node.js 24</h3> <p>This release updates the runtime to Node.js 24. v6 had preliminary support for Node 24, however this action was by default still running on Node.js 20. Now this action by default will run on Node.js 24.</p> <h2>What's Changed</h2> <ul> <li>Update GHES guidance to include reference to Node 20 version by <a href="https://github.com/patrikpolyak"><code>@patrikpolyak</code></a> in <a href="https://redirect.github.com/actions/download-artifact/pull/440">actions/download-artifact#440</a></li> <li>Download Artifact Node24 support by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/download-artifact/pull/415">actions/download-artifact#415</a></li> <li>fix: update <code>@actions/artifact</code> to fix Node.js 24 punycode deprecation by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/download-artifact/pull/451">actions/download-artifact#451</a></li> <li>prepare release v7.0.0 for Node.js 24 support by <a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> in <a href="https://redirect.github.com/actions/download-artifact/pull/452">actions/download-artifact#452</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/patrikpolyak"><code>@patrikpolyak</code></a> made their first contribution in <a href="https://redirect.github.com/actions/download-artifact/pull/440">actions/download-artifact#440</a></li> <li><a href="https://github.com/salmanmkc"><code>@salmanmkc</code></a> made their first contribution in <a href="https://redirect.github.com/actions/download-artifact/pull/415">actions/download-artifact#415</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/download-artifact/compare/v6.0.0...v7.0.0">https://github.com/actions/download-artifact/compare/v6.0.0...v7.0.0</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/download-artifact/commit/37930b1c2abaa49bbe596cd826c3c89aef350131"><code>37930b1</code></a> Merge pull request <a href="https://redirect.github.com/actions/download-artifact/issues/452">#452</a> from actions/download-artifact-v7-release</li> <li><a href="https://github.com/actions/download-artifact/commit/72582b9e0acd370909e83fa4a1fd0fca3ad452d8"><code>72582b9</code></a> doc: update readme</li> <li><a href="https://github.com/actions/download-artifact/commit/0d2ec9d4cbcefe257d822f108de2a1f15f8da9f6"><code>0d2ec9d</code></a> chore: release v7.0.0 for Node.js 24 support</li> <li><a href="https://github.com/actions/download-artifact/commit/fd7ae8fda6dc16277a9ffbc91cdb0eedf156e912"><code>fd7ae8f</code></a> Merge pull request <a href="https://redirect.github.com/actions/download-artifact/issues/451">#451</a> from actions/fix-storage-blob</li> <li><a href="https://github.com/actions/download-artifact/commit/d484700543354b15886d6a52910cf61b7f1d2b27"><code>d484700</code></a> chore: restore minimatch.dep.yml license file</li> <li><a href="https://github.com/actions/download-artifact/commit/03a808050efe42bb6ad85281890afd4e4546672c"><code>03a8080</code></a> chore: remove obsolete dependency license files</li> <li><a href="https://github.com/actions/download-artifact/commit/56fe6d904b0968950f8b68ea17774c54973ed5e2"><code>56fe6d9</code></a> chore: update <code>@actions/artifact</code> license file to 5.0.1</li> <li><a href="https://github.com/actions/download-artifact/commit/8e3ebc4ab4d2e095e5eb44ba1a4a53b6b03976ad"><code>8e3ebc4</code></a> chore: update package-lock.json with <code>@actions/artifact</code><a href="https://github.com/5"><code>@5</code></a>.0.1</li> <li><a href="https://github.com/actions/download-artifact/commit/1e3c4b4d4906c98ab57453c24efefdf16c078044"><code>1e3c4b4</code></a> fix: update <code>@actions/artifact</code> to ^5.0.0 for Node.js 24 punycode fix</li> <li><a href="https://github.com/actions/download-artifact/commit/458627d354794c71bc386c8d5839d20b5885fe2a"><code>458627d</code></a> chore: use local <code>@actions/artifact</code> package for Node.js 24 testing</li> <li>Additional commits viewable in <a href="https://github.com/actions/download-artifact/compare/018cc2cf5baa6db3ef3c5f8a56943fffe632ef53...37930b1c2abaa49bbe596cd826c3c89aef350131">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
996 lines
39 KiB
YAML
996 lines
39 KiB
YAML
# GitHub release workflow.
|
|
name: Release
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
release_channel:
|
|
type: choice
|
|
description: Release channel
|
|
options:
|
|
- mainline
|
|
- stable
|
|
release_notes:
|
|
description: Release notes for the publishing the release. This is required to create a release.
|
|
dry_run:
|
|
description: Perform a dry-run release (devel). Note that ref must be an annotated tag when run without dry-run.
|
|
type: boolean
|
|
required: true
|
|
default: false
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
env:
|
|
# Use `inputs` (vs `github.event.inputs`) to ensure that booleans are actual
|
|
# booleans, not strings.
|
|
# https://github.blog/changelog/2022-06-10-github-actions-inputs-unified-across-manual-and-reusable-workflows/
|
|
CODER_RELEASE: ${{ !inputs.dry_run }}
|
|
CODER_DRY_RUN: ${{ inputs.dry_run }}
|
|
CODER_RELEASE_CHANNEL: ${{ inputs.release_channel }}
|
|
CODER_RELEASE_NOTES: ${{ inputs.release_notes }}
|
|
|
|
jobs:
|
|
# Only allow maintainers/admins to release.
|
|
check-perms:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
steps:
|
|
- name: Allow only maintainers/admins
|
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
script: |
|
|
const {data} = await github.rest.repos.getCollaboratorPermissionLevel({
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
username: context.actor
|
|
});
|
|
const role = data.role_name || data.user?.role_name || data.permission;
|
|
const perms = data.user?.permissions || {};
|
|
core.info(`Actor ${context.actor} permission=${data.permission}, role_name=${role}`);
|
|
|
|
const allowed =
|
|
role === 'admin' ||
|
|
role === 'maintain' ||
|
|
perms.admin === true ||
|
|
perms.maintain === true;
|
|
|
|
if (!allowed) core.setFailed('Denied: requires maintain or admin');
|
|
|
|
# build-dylib is a separate job to build the dylib on macOS.
|
|
build-dylib:
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-latest' || 'macos-latest' }}
|
|
needs: check-perms
|
|
steps:
|
|
# Harden Runner doesn't work on macOS.
|
|
- name: Checkout
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
# If the event that triggered the build was an annotated tag (which our
|
|
# tags are supposed to be), actions/checkout has a bug where the tag in
|
|
# question is only a lightweight tag and not a full annotated tag. This
|
|
# command seems to fix it.
|
|
# https://github.com/actions/checkout/issues/290
|
|
- name: Fetch git tags
|
|
run: git fetch --tags --force
|
|
|
|
- name: Setup build tools
|
|
run: |
|
|
brew install bash gnu-getopt make
|
|
{
|
|
echo "$(brew --prefix bash)/bin"
|
|
echo "$(brew --prefix gnu-getopt)/bin"
|
|
echo "$(brew --prefix make)/libexec/gnubin"
|
|
} >> "$GITHUB_PATH"
|
|
|
|
- name: Switch XCode Version
|
|
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
|
|
with:
|
|
xcode-version: "16.1.0"
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Install rcodesign
|
|
run: |
|
|
set -euo pipefail
|
|
wget -O /tmp/rcodesign.tar.gz https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-macos-universal.tar.gz
|
|
sudo tar -xzf /tmp/rcodesign.tar.gz \
|
|
-C /usr/local/bin \
|
|
--strip-components=1 \
|
|
apple-codesign-0.22.0-macos-universal/rcodesign
|
|
rm /tmp/rcodesign.tar.gz
|
|
|
|
- name: Setup Apple Developer certificate and API key
|
|
run: |
|
|
set -euo pipefail
|
|
touch /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
chmod 600 /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
echo "$AC_CERTIFICATE_P12_BASE64" | base64 -d > /tmp/apple_cert.p12
|
|
echo "$AC_CERTIFICATE_PASSWORD" > /tmp/apple_cert_password.txt
|
|
echo "$AC_APIKEY_P8_BASE64" | base64 -d > /tmp/apple_apikey.p8
|
|
env:
|
|
AC_CERTIFICATE_P12_BASE64: ${{ secrets.AC_CERTIFICATE_P12_BASE64 }}
|
|
AC_CERTIFICATE_PASSWORD: ${{ secrets.AC_CERTIFICATE_PASSWORD }}
|
|
AC_APIKEY_P8_BASE64: ${{ secrets.AC_APIKEY_P8_BASE64 }}
|
|
|
|
- name: Build dylibs
|
|
run: |
|
|
set -euxo pipefail
|
|
go mod download
|
|
|
|
make gen/mark-fresh
|
|
make build/coder-dylib
|
|
env:
|
|
CODER_SIGN_DARWIN: 1
|
|
AC_CERTIFICATE_FILE: /tmp/apple_cert.p12
|
|
AC_CERTIFICATE_PASSWORD_FILE: /tmp/apple_cert_password.txt
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: dylibs
|
|
path: |
|
|
./build/*.h
|
|
./build/*.dylib
|
|
retention-days: 7
|
|
|
|
- name: Delete Apple Developer certificate and API key
|
|
run: rm -f /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
|
|
release:
|
|
name: Build and publish
|
|
needs: [build-dylib, check-perms]
|
|
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-8' || 'ubuntu-latest' }}
|
|
permissions:
|
|
# Required to publish a release
|
|
contents: write
|
|
# Necessary to push docker images to ghcr.io.
|
|
packages: write
|
|
# Necessary for GCP authentication (https://github.com/google-github-actions/setup-gcloud#usage)
|
|
# Also necessary for keyless cosign (https://docs.sigstore.dev/cosign/signing/overview/)
|
|
# And for GitHub Actions attestation
|
|
id-token: write
|
|
# Required for GitHub Actions attestation
|
|
attestations: write
|
|
env:
|
|
# Necessary for Docker manifest
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
|
outputs:
|
|
version: ${{ steps.version.outputs.version }}
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
# If the event that triggered the build was an annotated tag (which our
|
|
# tags are supposed to be), actions/checkout has a bug where the tag in
|
|
# question is only a lightweight tag and not a full annotated tag. This
|
|
# command seems to fix it.
|
|
# https://github.com/actions/checkout/issues/290
|
|
- name: Fetch git tags
|
|
run: git fetch --tags --force
|
|
|
|
- name: Print version
|
|
id: version
|
|
run: |
|
|
set -euo pipefail
|
|
version="$(./scripts/version.sh)"
|
|
echo "version=$version" >> "$GITHUB_OUTPUT"
|
|
# Speed up future version.sh calls.
|
|
echo "CODER_FORCE_VERSION=$version" >> "$GITHUB_ENV"
|
|
echo "$version"
|
|
|
|
# Verify that all expectations for a release are met.
|
|
- name: Verify release input
|
|
if: ${{ !inputs.dry_run }}
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
if [[ "${GITHUB_REF}" != "refs/tags/v"* ]]; then
|
|
echo "Ref must be a semver tag when creating a release, did you use scripts/release.sh?"
|
|
exit 1
|
|
fi
|
|
|
|
# 2.10.2 -> release/2.10
|
|
version="$(./scripts/version.sh)"
|
|
release_branch=release/${version%.*}
|
|
branch_contains_tag=$(git branch --remotes --contains "${GITHUB_REF}" --list "*/${release_branch}" --format='%(refname)')
|
|
if [[ -z "${branch_contains_tag}" ]]; then
|
|
echo "Ref tag must exist in a branch named ${release_branch} when creating a release, did you use scripts/release.sh?"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -z "${CODER_RELEASE_NOTES}" ]]; then
|
|
echo "Release notes are required to create a release, did you use scripts/release.sh?"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Release inputs verified:"
|
|
echo
|
|
echo "- Ref: ${GITHUB_REF}"
|
|
echo "- Version: ${version}"
|
|
echo "- Release channel: ${CODER_RELEASE_CHANNEL}"
|
|
echo "- Release branch: ${release_branch}"
|
|
echo "- Release notes: true"
|
|
|
|
- name: Create release notes file
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
release_notes_file="$(mktemp -t release_notes.XXXXXX)"
|
|
echo "$CODER_RELEASE_NOTES" > "$release_notes_file"
|
|
echo CODER_RELEASE_NOTES_FILE="$release_notes_file" >> "$GITHUB_ENV"
|
|
|
|
- name: Show release notes
|
|
run: |
|
|
set -euo pipefail
|
|
cat "$CODER_RELEASE_NOTES_FILE"
|
|
|
|
- name: Docker Login
|
|
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Setup Node
|
|
uses: ./.github/actions/setup-node
|
|
|
|
# Necessary for signing Windows binaries.
|
|
- name: Setup Java
|
|
uses: actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
|
|
with:
|
|
distribution: "zulu"
|
|
java-version: "11.0"
|
|
|
|
- name: Install go-winres
|
|
run: go install github.com/tc-hib/go-winres@d743268d7ea168077ddd443c4240562d4f5e8c3e # v0.3.3
|
|
|
|
- name: Install nsis and zstd
|
|
run: sudo apt-get install -y nsis zstd
|
|
|
|
- name: Install nfpm
|
|
run: |
|
|
set -euo pipefail
|
|
wget -O /tmp/nfpm.deb https://github.com/goreleaser/nfpm/releases/download/v2.35.1/nfpm_2.35.1_amd64.deb
|
|
sudo dpkg -i /tmp/nfpm.deb
|
|
rm /tmp/nfpm.deb
|
|
|
|
- name: Install rcodesign
|
|
run: |
|
|
set -euo pipefail
|
|
wget -O /tmp/rcodesign.tar.gz https://github.com/indygreg/apple-platform-rs/releases/download/apple-codesign%2F0.22.0/apple-codesign-0.22.0-x86_64-unknown-linux-musl.tar.gz
|
|
sudo tar -xzf /tmp/rcodesign.tar.gz \
|
|
-C /usr/bin \
|
|
--strip-components=1 \
|
|
apple-codesign-0.22.0-x86_64-unknown-linux-musl/rcodesign
|
|
rm /tmp/rcodesign.tar.gz
|
|
|
|
- name: Install cosign
|
|
uses: ./.github/actions/install-cosign
|
|
|
|
- name: Install syft
|
|
uses: ./.github/actions/install-syft
|
|
|
|
- name: Setup Apple Developer certificate and API key
|
|
run: |
|
|
set -euo pipefail
|
|
touch /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
chmod 600 /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
echo "$AC_CERTIFICATE_P12_BASE64" | base64 -d > /tmp/apple_cert.p12
|
|
echo "$AC_CERTIFICATE_PASSWORD" > /tmp/apple_cert_password.txt
|
|
echo "$AC_APIKEY_P8_BASE64" | base64 -d > /tmp/apple_apikey.p8
|
|
env:
|
|
AC_CERTIFICATE_P12_BASE64: ${{ secrets.AC_CERTIFICATE_P12_BASE64 }}
|
|
AC_CERTIFICATE_PASSWORD: ${{ secrets.AC_CERTIFICATE_PASSWORD }}
|
|
AC_APIKEY_P8_BASE64: ${{ secrets.AC_APIKEY_P8_BASE64 }}
|
|
|
|
- name: Setup Windows EV Signing Certificate
|
|
run: |
|
|
set -euo pipefail
|
|
touch /tmp/ev_cert.pem
|
|
chmod 600 /tmp/ev_cert.pem
|
|
echo "$EV_SIGNING_CERT" > /tmp/ev_cert.pem
|
|
wget https://github.com/ebourg/jsign/releases/download/6.0/jsign-6.0.jar -O /tmp/jsign-6.0.jar
|
|
env:
|
|
EV_SIGNING_CERT: ${{ secrets.EV_SIGNING_CERT }}
|
|
|
|
- name: Test migrations from current ref to main
|
|
run: |
|
|
POSTGRES_VERSION=13 make test-migrations
|
|
|
|
# Setup GCloud for signing Windows binaries.
|
|
- name: Authenticate to Google Cloud
|
|
id: gcloud_auth
|
|
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
|
|
with:
|
|
workload_identity_provider: ${{ vars.GCP_CODE_SIGNING_WORKLOAD_ID_PROVIDER }}
|
|
service_account: ${{ vars.GCP_CODE_SIGNING_SERVICE_ACCOUNT }}
|
|
token_format: "access_token"
|
|
|
|
- name: Setup GCloud SDK
|
|
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # v3.0.1
|
|
|
|
- name: Download dylibs
|
|
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
|
with:
|
|
name: dylibs
|
|
path: ./build
|
|
|
|
- name: Insert dylibs
|
|
run: |
|
|
mv ./build/*amd64.dylib ./site/out/bin/coder-vpn-darwin-amd64.dylib
|
|
mv ./build/*arm64.dylib ./site/out/bin/coder-vpn-darwin-arm64.dylib
|
|
mv ./build/*arm64.h ./site/out/bin/coder-vpn-darwin-dylib.h
|
|
|
|
- name: Build binaries
|
|
run: |
|
|
set -euo pipefail
|
|
go mod download
|
|
|
|
version="$(./scripts/version.sh)"
|
|
make gen/mark-fresh
|
|
make -j \
|
|
build/coder_"$version"_linux_{amd64,armv7,arm64}.{tar.gz,apk,deb,rpm} \
|
|
build/coder_"$version"_{darwin,windows}_{amd64,arm64}.zip \
|
|
build/coder_"$version"_windows_amd64_installer.exe \
|
|
build/coder_helm_"$version".tgz \
|
|
build/provisioner_helm_"$version".tgz
|
|
env:
|
|
CODER_SIGN_WINDOWS: "1"
|
|
CODER_SIGN_DARWIN: "1"
|
|
CODER_SIGN_GPG: "1"
|
|
CODER_GPG_RELEASE_KEY_BASE64: ${{ secrets.GPG_RELEASE_KEY_BASE64 }}
|
|
CODER_WINDOWS_RESOURCES: "1"
|
|
AC_CERTIFICATE_FILE: /tmp/apple_cert.p12
|
|
AC_CERTIFICATE_PASSWORD_FILE: /tmp/apple_cert_password.txt
|
|
AC_APIKEY_ISSUER_ID: ${{ secrets.AC_APIKEY_ISSUER_ID }}
|
|
AC_APIKEY_ID: ${{ secrets.AC_APIKEY_ID }}
|
|
AC_APIKEY_FILE: /tmp/apple_apikey.p8
|
|
EV_KEY: ${{ secrets.EV_KEY }}
|
|
EV_KEYSTORE: ${{ secrets.EV_KEYSTORE }}
|
|
EV_TSA_URL: ${{ secrets.EV_TSA_URL }}
|
|
EV_CERTIFICATE_PATH: /tmp/ev_cert.pem
|
|
GCLOUD_ACCESS_TOKEN: ${{ steps.gcloud_auth.outputs.access_token }}
|
|
JSIGN_PATH: /tmp/jsign-6.0.jar
|
|
|
|
- name: Delete Apple Developer certificate and API key
|
|
run: rm -f /tmp/{apple_cert.p12,apple_cert_password.txt,apple_apikey.p8}
|
|
|
|
- name: Delete Windows EV Signing Cert
|
|
run: rm /tmp/ev_cert.pem
|
|
|
|
- name: Determine base image tag
|
|
id: image-base-tag
|
|
run: |
|
|
set -euo pipefail
|
|
if [[ "${CODER_RELEASE:-}" != *t* ]] || [[ "${CODER_DRY_RUN:-}" == *t* ]]; then
|
|
# Empty value means use the default and avoid building a fresh one.
|
|
echo "tag=" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "tag=$(CODER_IMAGE_BASE=ghcr.io/coder/coder-base ./scripts/image_tag.sh)" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
|
|
- name: Create empty base-build-context directory
|
|
if: steps.image-base-tag.outputs.tag != ''
|
|
run: mkdir base-build-context
|
|
|
|
- name: Install depot.dev CLI
|
|
if: steps.image-base-tag.outputs.tag != ''
|
|
uses: depot/setup-action@b0b1ea4f69e92ebf5dea3f8713a1b0c37b2126a5 # v1.6.0
|
|
|
|
# This uses OIDC authentication, so no auth variables are required.
|
|
- name: Build base Docker image via depot.dev
|
|
if: steps.image-base-tag.outputs.tag != ''
|
|
uses: depot/build-push-action@9785b135c3c76c33db102e45be96a25ab55cd507 # v1.16.2
|
|
with:
|
|
project: wl5hnrrkns
|
|
context: base-build-context
|
|
file: scripts/Dockerfile.base
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
provenance: true
|
|
sbom: true
|
|
pull: true
|
|
no-cache: true
|
|
push: true
|
|
tags: |
|
|
${{ steps.image-base-tag.outputs.tag }}
|
|
|
|
- name: Verify that images are pushed properly
|
|
if: steps.image-base-tag.outputs.tag != ''
|
|
run: |
|
|
# retry 10 times with a 5 second delay as the images may not be
|
|
# available immediately
|
|
for i in {1..10}; do
|
|
rc=0
|
|
raw_manifests=$(docker buildx imagetools inspect --raw "${IMAGE_TAG}") || rc=$?
|
|
if [[ "$rc" -eq 0 ]]; then
|
|
break
|
|
fi
|
|
if [[ "$i" -eq 10 ]]; then
|
|
echo "Failed to pull manifests after 10 retries"
|
|
exit 1
|
|
fi
|
|
echo "Failed to pull manifests, retrying in 5 seconds"
|
|
sleep 5
|
|
done
|
|
|
|
manifests=$(
|
|
echo "$raw_manifests" | \
|
|
jq -r '.manifests[].platform | .os + "/" + .architecture + (if .variant then "/" + .variant else "" end)'
|
|
)
|
|
|
|
# Verify all 3 platforms are present.
|
|
set -euxo pipefail
|
|
echo "$manifests" | grep -q linux/amd64
|
|
echo "$manifests" | grep -q linux/arm64
|
|
echo "$manifests" | grep -q linux/arm/v7
|
|
env:
|
|
IMAGE_TAG: ${{ steps.image-base-tag.outputs.tag }}
|
|
|
|
# GitHub attestation provides SLSA provenance for Docker images, establishing a verifiable
|
|
# record that these images were built in GitHub Actions with specific inputs and environment.
|
|
# This complements our existing cosign attestations (which focus on SBOMs) by adding
|
|
# GitHub-specific build provenance to enhance our supply chain security.
|
|
#
|
|
# TODO: Consider refactoring these attestation steps to use a matrix strategy or composite action
|
|
# to reduce duplication while maintaining the required functionality for each distinct image tag.
|
|
- name: GitHub Attestation for Base Docker image
|
|
id: attest_base
|
|
if: ${{ !inputs.dry_run && steps.image-base-tag.outputs.tag != '' }}
|
|
continue-on-error: true
|
|
uses: actions/attest@daf44fb950173508f38bd2406030372c1d1162b1 # v3.0.0
|
|
with:
|
|
subject-name: ${{ steps.image-base-tag.outputs.tag }}
|
|
predicate-type: "https://slsa.dev/provenance/v1"
|
|
predicate: |
|
|
{
|
|
"buildType": "https://github.com/actions/runner-images/",
|
|
"builder": {
|
|
"id": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
},
|
|
"invocation": {
|
|
"configSource": {
|
|
"uri": "git+https://github.com/${{ github.repository }}@${{ github.ref }}",
|
|
"digest": {
|
|
"sha1": "${{ github.sha }}"
|
|
},
|
|
"entryPoint": ".github/workflows/release.yaml"
|
|
},
|
|
"environment": {
|
|
"github_workflow": "${{ github.workflow }}",
|
|
"github_run_id": "${{ github.run_id }}"
|
|
}
|
|
},
|
|
"metadata": {
|
|
"buildInvocationID": "${{ github.run_id }}",
|
|
"completeness": {
|
|
"environment": true,
|
|
"materials": true
|
|
}
|
|
}
|
|
}
|
|
push-to-registry: true
|
|
|
|
- name: Build Linux Docker images
|
|
id: build_docker
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
# we can't build multi-arch if the images aren't pushed, so quit now
|
|
# if dry-running
|
|
if [[ "$CODER_RELEASE" != *t* ]]; then
|
|
echo Skipping multi-arch docker builds due to dry-run.
|
|
exit 0
|
|
fi
|
|
|
|
# build Docker images for each architecture
|
|
version="$(./scripts/version.sh)"
|
|
make build/coder_"$version"_linux_{amd64,arm64,armv7}.tag
|
|
|
|
# build and push multi-arch manifest, this depends on the other images
|
|
# being pushed so will automatically push them.
|
|
make push/build/coder_"$version"_linux.tag
|
|
|
|
# Save multiarch image tag for attestation
|
|
multiarch_image="$(./scripts/image_tag.sh)"
|
|
echo "multiarch_image=${multiarch_image}" >> "$GITHUB_OUTPUT"
|
|
|
|
# For debugging, print all docker image tags
|
|
docker images
|
|
|
|
# if the current version is equal to the highest (according to semver)
|
|
# version in the repo, also create a multi-arch image as ":latest" and
|
|
# push it
|
|
if [[ "$(git tag | grep '^v' | grep -vE '(rc|dev|-|\+|\/)' | sort -r --version-sort | head -n1)" == "v$(./scripts/version.sh)" ]]; then
|
|
# shellcheck disable=SC2046
|
|
./scripts/build_docker_multiarch.sh \
|
|
--push \
|
|
--target "$(./scripts/image_tag.sh --version latest)" \
|
|
$(cat build/coder_"$version"_linux_{amd64,arm64,armv7}.tag)
|
|
echo "created_latest_tag=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "created_latest_tag=false" >> "$GITHUB_OUTPUT"
|
|
fi
|
|
env:
|
|
CODER_BASE_IMAGE_TAG: ${{ steps.image-base-tag.outputs.tag }}
|
|
|
|
- name: SBOM Generation and Attestation
|
|
if: ${{ !inputs.dry_run }}
|
|
env:
|
|
COSIGN_EXPERIMENTAL: '1'
|
|
MULTIARCH_IMAGE: ${{ steps.build_docker.outputs.multiarch_image }}
|
|
VERSION: ${{ steps.version.outputs.version }}
|
|
CREATED_LATEST_TAG: ${{ steps.build_docker.outputs.created_latest_tag }}
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
# Generate SBOM for multi-arch image with version in filename
|
|
echo "Generating SBOM for multi-arch image: ${MULTIARCH_IMAGE}"
|
|
syft "${MULTIARCH_IMAGE}" -o spdx-json > "coder_${VERSION}_sbom.spdx.json"
|
|
|
|
# Attest SBOM to multi-arch image
|
|
echo "Attesting SBOM to multi-arch image: ${MULTIARCH_IMAGE}"
|
|
cosign clean --force=true "${MULTIARCH_IMAGE}"
|
|
cosign attest --type spdxjson \
|
|
--predicate "coder_${VERSION}_sbom.spdx.json" \
|
|
--yes \
|
|
"${MULTIARCH_IMAGE}"
|
|
|
|
# If latest tag was created, also attest it
|
|
if [[ "${CREATED_LATEST_TAG}" == "true" ]]; then
|
|
latest_tag="$(./scripts/image_tag.sh --version latest)"
|
|
echo "Generating SBOM for latest image: ${latest_tag}"
|
|
syft "${latest_tag}" -o spdx-json > coder_latest_sbom.spdx.json
|
|
|
|
echo "Attesting SBOM to latest image: ${latest_tag}"
|
|
cosign clean --force=true "${latest_tag}"
|
|
cosign attest --type spdxjson \
|
|
--predicate coder_latest_sbom.spdx.json \
|
|
--yes \
|
|
"${latest_tag}"
|
|
fi
|
|
|
|
- name: GitHub Attestation for Docker image
|
|
id: attest_main
|
|
if: ${{ !inputs.dry_run }}
|
|
continue-on-error: true
|
|
uses: actions/attest@daf44fb950173508f38bd2406030372c1d1162b1 # v3.0.0
|
|
with:
|
|
subject-name: ${{ steps.build_docker.outputs.multiarch_image }}
|
|
predicate-type: "https://slsa.dev/provenance/v1"
|
|
predicate: |
|
|
{
|
|
"buildType": "https://github.com/actions/runner-images/",
|
|
"builder": {
|
|
"id": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
},
|
|
"invocation": {
|
|
"configSource": {
|
|
"uri": "git+https://github.com/${{ github.repository }}@${{ github.ref }}",
|
|
"digest": {
|
|
"sha1": "${{ github.sha }}"
|
|
},
|
|
"entryPoint": ".github/workflows/release.yaml"
|
|
},
|
|
"environment": {
|
|
"github_workflow": "${{ github.workflow }}",
|
|
"github_run_id": "${{ github.run_id }}"
|
|
}
|
|
},
|
|
"metadata": {
|
|
"buildInvocationID": "${{ github.run_id }}",
|
|
"completeness": {
|
|
"environment": true,
|
|
"materials": true
|
|
}
|
|
}
|
|
}
|
|
push-to-registry: true
|
|
|
|
# Get the latest tag name for attestation
|
|
- name: Get latest tag name
|
|
id: latest_tag
|
|
if: ${{ !inputs.dry_run && steps.build_docker.outputs.created_latest_tag == 'true' }}
|
|
run: echo "tag=$(./scripts/image_tag.sh --version latest)" >> "$GITHUB_OUTPUT"
|
|
|
|
# If this is the highest version according to semver, also attest the "latest" tag
|
|
- name: GitHub Attestation for "latest" Docker image
|
|
id: attest_latest
|
|
if: ${{ !inputs.dry_run && steps.build_docker.outputs.created_latest_tag == 'true' }}
|
|
continue-on-error: true
|
|
uses: actions/attest@daf44fb950173508f38bd2406030372c1d1162b1 # v3.0.0
|
|
with:
|
|
subject-name: ${{ steps.latest_tag.outputs.tag }}
|
|
predicate-type: "https://slsa.dev/provenance/v1"
|
|
predicate: |
|
|
{
|
|
"buildType": "https://github.com/actions/runner-images/",
|
|
"builder": {
|
|
"id": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
|
},
|
|
"invocation": {
|
|
"configSource": {
|
|
"uri": "git+https://github.com/${{ github.repository }}@${{ github.ref }}",
|
|
"digest": {
|
|
"sha1": "${{ github.sha }}"
|
|
},
|
|
"entryPoint": ".github/workflows/release.yaml"
|
|
},
|
|
"environment": {
|
|
"github_workflow": "${{ github.workflow }}",
|
|
"github_run_id": "${{ github.run_id }}"
|
|
}
|
|
},
|
|
"metadata": {
|
|
"buildInvocationID": "${{ github.run_id }}",
|
|
"completeness": {
|
|
"environment": true,
|
|
"materials": true
|
|
}
|
|
}
|
|
}
|
|
push-to-registry: true
|
|
|
|
# Report attestation failures but don't fail the workflow
|
|
- name: Check attestation status
|
|
if: ${{ !inputs.dry_run }}
|
|
run: | # zizmor: ignore[template-injection] We're just reading steps.attest_x.outcome here, no risk of injection
|
|
if [[ "${{ steps.attest_base.outcome }}" == "failure" && "${{ steps.attest_base.conclusion }}" != "skipped" ]]; then
|
|
echo "::warning::GitHub attestation for base image failed"
|
|
fi
|
|
if [[ "${{ steps.attest_main.outcome }}" == "failure" ]]; then
|
|
echo "::warning::GitHub attestation for main image failed"
|
|
fi
|
|
if [[ "${{ steps.attest_latest.outcome }}" == "failure" && "${{ steps.attest_latest.conclusion }}" != "skipped" ]]; then
|
|
echo "::warning::GitHub attestation for latest image failed"
|
|
fi
|
|
|
|
- name: Generate offline docs
|
|
run: |
|
|
version="$(./scripts/version.sh)"
|
|
make -j build/coder_docs_"$version".tgz
|
|
|
|
- name: ls build
|
|
run: ls -lh build
|
|
|
|
- name: Publish Coder CLI binaries and detached signatures to GCS
|
|
if: ${{ !inputs.dry_run }}
|
|
run: |
|
|
set -euxo pipefail
|
|
|
|
version="$(./scripts/version.sh)"
|
|
|
|
# Source array of slim binaries
|
|
declare -A binaries
|
|
binaries["coder-darwin-amd64"]="coder-slim_${version}_darwin_amd64"
|
|
binaries["coder-darwin-arm64"]="coder-slim_${version}_darwin_arm64"
|
|
binaries["coder-linux-amd64"]="coder-slim_${version}_linux_amd64"
|
|
binaries["coder-linux-arm64"]="coder-slim_${version}_linux_arm64"
|
|
binaries["coder-linux-armv7"]="coder-slim_${version}_linux_armv7"
|
|
binaries["coder-windows-amd64.exe"]="coder-slim_${version}_windows_amd64.exe"
|
|
binaries["coder-windows-arm64.exe"]="coder-slim_${version}_windows_arm64.exe"
|
|
|
|
for cli_name in "${!binaries[@]}"; do
|
|
slim_binary="${binaries[$cli_name]}"
|
|
detached_signature="${slim_binary}.asc"
|
|
gcloud storage cp "./build/${slim_binary}" "gs://releases.coder.com/coder-cli/${version}/${cli_name}"
|
|
gcloud storage cp "./build/${detached_signature}" "gs://releases.coder.com/coder-cli/${version}/${cli_name}.asc"
|
|
done
|
|
|
|
- name: Publish release
|
|
run: |
|
|
set -euo pipefail
|
|
|
|
publish_args=()
|
|
if [[ $CODER_RELEASE_CHANNEL == "stable" ]]; then
|
|
publish_args+=(--stable)
|
|
fi
|
|
if [[ $CODER_DRY_RUN == *t* ]]; then
|
|
publish_args+=(--dry-run)
|
|
fi
|
|
declare -p publish_args
|
|
|
|
# Build the list of files to publish
|
|
files=(
|
|
./build/*_installer.exe
|
|
./build/*.zip
|
|
./build/*.tar.gz
|
|
./build/*.tgz
|
|
./build/*.apk
|
|
./build/*.deb
|
|
./build/*.rpm
|
|
"./coder_${VERSION}_sbom.spdx.json"
|
|
)
|
|
|
|
# Only include the latest SBOM file if it was created
|
|
if [[ "${CREATED_LATEST_TAG}" == "true" ]]; then
|
|
files+=(./coder_latest_sbom.spdx.json)
|
|
fi
|
|
|
|
./scripts/release/publish.sh \
|
|
"${publish_args[@]}" \
|
|
--release-notes-file "$CODER_RELEASE_NOTES_FILE" \
|
|
"${files[@]}"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
CODER_GPG_RELEASE_KEY_BASE64: ${{ secrets.GPG_RELEASE_KEY_BASE64 }}
|
|
VERSION: ${{ steps.version.outputs.version }}
|
|
CREATED_LATEST_TAG: ${{ steps.build_docker.outputs.created_latest_tag }}
|
|
|
|
- name: Authenticate to Google Cloud
|
|
uses: google-github-actions/auth@7c6bc770dae815cd3e89ee6cdf493a5fab2cc093 # v3.0.0
|
|
with:
|
|
workload_identity_provider: ${{ vars.GCP_WORKLOAD_ID_PROVIDER }}
|
|
service_account: ${{ vars.GCP_SERVICE_ACCOUNT }}
|
|
|
|
- name: Setup GCloud SDK
|
|
uses: google-github-actions/setup-gcloud@aa5489c8933f4cc7a4f7d45035b3b1440c9c10db # 3.0.1
|
|
|
|
- name: Publish Helm Chart
|
|
if: ${{ !inputs.dry_run }}
|
|
run: |
|
|
set -euo pipefail
|
|
version="$(./scripts/version.sh)"
|
|
mkdir -p build/helm
|
|
cp "build/coder_helm_${version}.tgz" build/helm
|
|
cp "build/provisioner_helm_${version}.tgz" build/helm
|
|
gsutil cp gs://helm.coder.com/v2/index.yaml build/helm/index.yaml
|
|
helm repo index build/helm --url https://helm.coder.com/v2 --merge build/helm/index.yaml
|
|
gsutil -h "Cache-Control:no-cache,max-age=0" cp "build/helm/coder_helm_${version}.tgz" gs://helm.coder.com/v2
|
|
gsutil -h "Cache-Control:no-cache,max-age=0" cp "build/helm/provisioner_helm_${version}.tgz" gs://helm.coder.com/v2
|
|
gsutil -h "Cache-Control:no-cache,max-age=0" cp "build/helm/index.yaml" gs://helm.coder.com/v2
|
|
gsutil -h "Cache-Control:no-cache,max-age=0" cp "helm/artifacthub-repo.yml" gs://helm.coder.com/v2
|
|
helm push "build/coder_helm_${version}.tgz" oci://ghcr.io/coder/chart
|
|
helm push "build/provisioner_helm_${version}.tgz" oci://ghcr.io/coder/chart
|
|
|
|
- name: Upload artifacts to actions (if dry-run)
|
|
if: ${{ inputs.dry_run }}
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: release-artifacts
|
|
path: |
|
|
./build/*_installer.exe
|
|
./build/*.zip
|
|
./build/*.tar.gz
|
|
./build/*.tgz
|
|
./build/*.apk
|
|
./build/*.deb
|
|
./build/*.rpm
|
|
./coder_${{ steps.version.outputs.version }}_sbom.spdx.json
|
|
retention-days: 7
|
|
|
|
- name: Upload latest sbom artifact to actions (if dry-run)
|
|
if: inputs.dry_run && steps.build_docker.outputs.created_latest_tag == 'true'
|
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
with:
|
|
name: latest-sbom-artifact
|
|
path: ./coder_latest_sbom.spdx.json
|
|
retention-days: 7
|
|
|
|
- name: Send repository-dispatch event
|
|
if: ${{ !inputs.dry_run }}
|
|
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
|
|
with:
|
|
token: ${{ secrets.CDRCI_GITHUB_TOKEN }}
|
|
repository: coder/packages
|
|
event-type: coder-release
|
|
client-payload: '{"coder_version": "${{ steps.version.outputs.version }}", "release_channel": "${{ inputs.release_channel }}"}'
|
|
|
|
publish-homebrew:
|
|
name: Publish to Homebrew tap
|
|
runs-on: ubuntu-latest
|
|
needs: release
|
|
if: ${{ !inputs.dry_run }}
|
|
|
|
steps:
|
|
# TODO: skip this if it's not a new release (i.e. a backport). This is
|
|
# fine right now because it just makes a PR that we can close.
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Update homebrew
|
|
env:
|
|
GH_REPO: coder/homebrew-coder
|
|
GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }}
|
|
VERSION: ${{ needs.release.outputs.version }}
|
|
run: |
|
|
# Keep version number around for reference, removing any potential leading v
|
|
coder_version="$(echo "${VERSION}" | tr -d v)"
|
|
|
|
set -euxo pipefail
|
|
|
|
# Setup Git
|
|
git config --global user.email "ci@coder.com"
|
|
git config --global user.name "Coder CI"
|
|
git config --global credential.helper "store"
|
|
|
|
temp_dir="$(mktemp -d)"
|
|
cd "$temp_dir"
|
|
|
|
# Download checksums
|
|
checksums_url="$(gh release view --repo coder/coder "v$coder_version" --json assets \
|
|
| jq -r ".assets | map(.url) | .[]" \
|
|
| grep -e ".checksums.txt\$")"
|
|
wget "$checksums_url" -O checksums.txt
|
|
|
|
# Get the SHAs
|
|
darwin_arm_sha="$(grep "darwin_arm64.zip" checksums.txt | awk '{ print $1 }')"
|
|
darwin_intel_sha="$(grep "darwin_amd64.zip" checksums.txt | awk '{ print $1 }')"
|
|
linux_sha="$(grep "linux_amd64.tar.gz" checksums.txt | awk '{ print $1 }')"
|
|
|
|
echo "macOS arm64: $darwin_arm_sha"
|
|
echo "macOS amd64: $darwin_intel_sha"
|
|
echo "Linux amd64: $linux_sha"
|
|
|
|
# Check out the homebrew repo
|
|
git clone "https://github.com/$GH_REPO" homebrew-coder
|
|
brew_branch="auto-release/$coder_version"
|
|
cd homebrew-coder
|
|
|
|
# Check if a PR already exists.
|
|
pr_count="$(gh pr list --search "head:$brew_branch" --json id,closed | jq -r ".[] | select(.closed == false) | .id" | wc -l)"
|
|
if [ "$pr_count" -gt 0 ]; then
|
|
echo "Bailing out as PR already exists" 2>&1
|
|
exit 0
|
|
fi
|
|
|
|
# Set up cdrci credentials for pushing to homebrew-coder
|
|
echo "https://x-access-token:$GH_TOKEN@github.com" >> ~/.git-credentials
|
|
# Update the formulae and push
|
|
git checkout -b "$brew_branch"
|
|
./scripts/update-v2.sh "$coder_version" "$darwin_arm_sha" "$darwin_intel_sha" "$linux_sha"
|
|
git add .
|
|
git commit -m "coder $coder_version"
|
|
git push -u origin -f "$brew_branch"
|
|
|
|
# Create PR
|
|
gh pr create \
|
|
-B master -H "$brew_branch" \
|
|
-t "coder $coder_version" \
|
|
-b "" \
|
|
-r "${GITHUB_ACTOR}" \
|
|
-a "${GITHUB_ACTOR}" \
|
|
-b "This automatic PR was triggered by the release of Coder v$coder_version"
|
|
|
|
publish-winget:
|
|
name: Publish to winget-pkgs
|
|
runs-on: windows-latest
|
|
needs: release
|
|
if: ${{ !inputs.dry_run }}
|
|
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Sync fork
|
|
run: gh repo sync cdrci/winget-pkgs -b master
|
|
env:
|
|
GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }}
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
# If the event that triggered the build was an annotated tag (which our
|
|
# tags are supposed to be), actions/checkout has a bug where the tag in
|
|
# question is only a lightweight tag and not a full annotated tag. This
|
|
# command seems to fix it.
|
|
# https://github.com/actions/checkout/issues/290
|
|
- name: Fetch git tags
|
|
run: git fetch --tags --force
|
|
|
|
- name: Install wingetcreate
|
|
run: |
|
|
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
|
|
|
- name: Submit updated manifest to winget-pkgs
|
|
run: |
|
|
# The package version is the same as the tag minus the leading "v".
|
|
# The version in this output already has the leading "v" removed but
|
|
# we do it again to be safe.
|
|
$version = $env:VERSION.Trim('v')
|
|
|
|
$release_assets = gh release view --repo coder/coder "v${version}" --json assets | `
|
|
ConvertFrom-Json
|
|
# Get the installer URLs from the release assets.
|
|
$amd64_installer_url = $release_assets.assets | `
|
|
Where-Object name -Match ".*_windows_amd64_installer.exe$" | `
|
|
Select -ExpandProperty url
|
|
$amd64_zip_url = $release_assets.assets | `
|
|
Where-Object name -Match ".*_windows_amd64.zip$" | `
|
|
Select -ExpandProperty url
|
|
$arm64_zip_url = $release_assets.assets | `
|
|
Where-Object name -Match ".*_windows_arm64.zip$" | `
|
|
Select -ExpandProperty url
|
|
|
|
echo "amd64 Installer URL: ${amd64_installer_url}"
|
|
echo "amd64 zip URL: ${amd64_zip_url}"
|
|
echo "arm64 zip URL: ${arm64_zip_url}"
|
|
echo "Package version: ${version}"
|
|
|
|
.\wingetcreate.exe update Coder.Coder `
|
|
--submit `
|
|
--version "${version}" `
|
|
--urls "${amd64_installer_url}" "${amd64_zip_url}" "${arm64_zip_url}" `
|
|
--token "$env:WINGET_GH_TOKEN"
|
|
|
|
env:
|
|
# For gh CLI:
|
|
GH_TOKEN: ${{ github.token }}
|
|
# For wingetcreate. We need a real token since we're pushing a commit
|
|
# to GitHub and then making a PR in a different repo.
|
|
WINGET_GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }}
|
|
VERSION: ${{ needs.release.outputs.version }}
|
|
|
|
- name: Comment on PR
|
|
run: |
|
|
# wait 30 seconds
|
|
Start-Sleep -Seconds 30.0
|
|
# Find the PR that wingetcreate just made.
|
|
$version = $env:VERSION.Trim('v')
|
|
$pr_list = gh pr list --repo microsoft/winget-pkgs --search "author:cdrci Coder.Coder version ${version}" --limit 1 --json number | `
|
|
ConvertFrom-Json
|
|
$pr_number = $pr_list[0].number
|
|
|
|
gh pr comment --repo microsoft/winget-pkgs "${pr_number}" --body "🤖 cc: @deansheather @matifali"
|
|
|
|
env:
|
|
# For gh CLI. We need a real token since we're commenting on a PR in a
|
|
# different repo.
|
|
GH_TOKEN: ${{ secrets.CDRCI_GITHUB_TOKEN }}
|
|
VERSION: ${{ needs.release.outputs.version }}
|
|
|
|
# publish-sqlc pushes the latest schema to sqlc cloud.
|
|
# At present these pushes cannot be tagged, so the last push is always the latest.
|
|
publish-sqlc:
|
|
name: "Publish to schema sqlc cloud"
|
|
runs-on: "ubuntu-latest"
|
|
needs: release
|
|
if: ${{ !inputs.dry_run }}
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
with:
|
|
fetch-depth: 1
|
|
persist-credentials: false
|
|
|
|
# We need golang to run the migration main.go
|
|
- name: Setup Go
|
|
uses: ./.github/actions/setup-go
|
|
|
|
- name: Setup sqlc
|
|
uses: ./.github/actions/setup-sqlc
|
|
|
|
- name: Push schema to sqlc cloud
|
|
# Don't block a release on this
|
|
continue-on-error: true
|
|
run: |
|
|
make sqlc-push
|