GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(release): write reviewed V2 release notes to CHANGELOG.md (#53964) · carllewis/opencode@d445615

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • publish.yml
  • CHANGELOG.md
  • script
    • publish.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/publish.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/publish.yml
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ on:
2525
required: false
2626
type: string
2727
release_notes:
28-
description: "Reviewed V2 release notes for the Discord announcement (optional)"
28+
description: "Reviewed V2 release notes for CHANGELOG.md and the Discord announcement (optional)"
2929
required: false
3030
type: string
3131

@@ -647,6 +647,7 @@ jobs:
647647
env:
648648
OPENCODE_VERSION: ${{ needs.version.outputs.version }}
649649
OPENCODE_RELEASE: ${{ needs.version.outputs.release }}
650+
OPENCODE_RELEASE_NOTES: ${{ (github.ref_name == 'v2' && inputs.release_notes) || '' }}
650651
AUR_KEY: ${{ secrets.AUR_KEY }}
651652
GITHUB_TOKEN: ${{ steps.committer.outputs.token }}
652653
GH_REPO: ${{ needs.version.outputs.repo }}
Collapse file

‎CHANGELOG.md‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
Release notes for OpenCode V2, newest first.
Collapse file

‎script/publish.ts‎

Copy file name to clipboardExpand all lines: script/publish.ts
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ async function prepareReleaseFiles() {
2727
await $`bun install`
2828
}
2929

30+
async function writeChangelog() {
31+
const notes = process.env["OPENCODE_RELEASE_NOTES"]?.trim()
32+
if (!notes) return
33+
const file = Bun.file("CHANGELOG.md")
34+
const text = await file.text()
35+
const lines = text.split("\n")
36+
if (lines.some((line) => line === `## ${tag}` || line.startsWith(`## ${tag} `))) return
37+
const index = lines.findIndex((line) => line.startsWith("## "))
38+
const head = (index === -1 ? lines : lines.slice(0, index)).join("\n").trimEnd()
39+
const rest = index === -1 ? "" : lines.slice(index).join("\n")
40+
const entry = `## ${tag} — ${new Date().toISOString().slice(0, 10)}\n\n${notes}\n`
41+
await file.write(`${head}\n\n${entry}${rest ? `\n${rest}` : ""}`)
42+
}
43+
3044
if (Script.release && !Script.preview) {
3145
await $`git fetch origin --tags`
3246
await $`git switch --detach`
@@ -90,6 +104,7 @@ if (Script.release && !Script.preview) {
90104
await $`git fetch origin`
91105
await $`git checkout -B v2 origin/v2`
92106
await prepareReleaseFiles()
107+
await writeChangelog()
93108
if ((await $`git diff --quiet`.nothrow()).exitCode !== 0) {
94109
// The release already published this code; a push-triggered dev publish of a version bump is wasted work.
95110
await $`git commit -am ${`sync release versions for ${tag} [skip ci]`}`

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.