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 — tweak · matleh/opencode@b5c6ddc

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • release.yml
  • packages/opencode/script
    • PKGBUILD.template
    • publish.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/release.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/release.yml
+4-6Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ jobs:
2828
cache: true
2929
cache-dependency-path: go.sum
3030

31-
- run: go mod download
31+
- uses: oven-sh/setup-bun@v2
32+
bun-version: 1.2.16
3233

33-
- uses: goreleaser/goreleaser-action@v6
34-
with:
35-
distribution: goreleaser
36-
version: latest
37-
args: release --clean
34+
- run: ./script/publish.ts
35+
dir: packages/opencode
3836
env:
3937
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
4038
AUR_KEY: ${{ secrets.AUR_KEY }}
Collapse file

‎packages/opencode/script/PKGBUILD.template‎

Copy file name to clipboard
+23Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Maintainer: dax
2+
# Maintainer: adam
3+
4+
pkgname='opencode-bin'
5+
pkgver={{VERSION}}
6+
pkgrel=1
7+
pkgdesc='The AI coding agent built for the terminal.'
8+
url='https://github.com/sst/opencode'
9+
arch=('aarch64' 'x86_64')
10+
license=('MIT')
11+
provides=('opencode')
12+
conflicts=('opencode')
13+
depends=('fzf' 'ripgrep')
14+
15+
source_aarch64=("${pkgname}_${pkgver}_aarch64.zip::{{ARM64_URL}}")
16+
sha256sums_aarch64=('{{ARM64_SHA}}')
17+
18+
source_x86_64=("${pkgname}_${pkgver}_x86_64.zip::{{X64_URL}}")
19+
sha256sums_x86_64=('{{X64_SHA}}')
20+
21+
package() {
22+
install -Dm755 ./opencode "${pkgdir}/usr/bin/opencode"
23+
}
Collapse file

‎packages/opencode/script/publish.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/script/publish.ts
+42Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ if (!dry)
8686
await $`cd ./dist/${pkg.name} && npm publish --access public --tag ${npmTag}`
8787

8888
if (!snapshot) {
89+
// Github Release
8990
for (const key of Object.keys(optionalDependencies)) {
9091
await $`cd dist/${key}/bin && zip -r ../../${key}.zip *`
9192
}
@@ -116,4 +117,45 @@ if (!snapshot) {
116117

117118
if (!dry)
118119
await $`gh release create v${version} --title "v${version}" --notes ${notes} ./dist/*.zip`
120+
121+
// AUR package
122+
const pkgbuildTemplate = await Bun.file("./script/PKGBUILD.template").text()
123+
const pkgbuild = pkgbuildTemplate
124+
.replace("{{VERSION}}", version.split("-")[0])
125+
.replace(
126+
"{{ARM64_URL}}",
127+
`https://github.com/sst/opencode/releases/download/v${version}/opencode-linux-arm64.zip`,
128+
)
129+
.replace(
130+
"{{ARM64_SHA}}",
131+
await $`sha256sum ./dist/opencode-linux-arm64.zip | cut -d' ' -f1`
132+
.text()
133+
.then((x) => x.trim()),
134+
)
135+
.replace(
136+
"{{X64_URL}}",
137+
`https://github.com/sst/opencode/releases/download/v${version}/opencode-linux-x64.zip`,
138+
)
139+
.replace(
140+
"{{X64_SHA}}",
141+
await $`sha256sum ./dist/opencode-linux-x64.zip | cut -d' ' -f1`
142+
.text()
143+
.then((x) => x.trim()),
144+
)
145+
146+
await $`rm -rf ./dist/aur-opencode-bin`
147+
const gitEnv: Record<string, string> = process.env["AUR_KEY"]
148+
? { GIT_SSH_COMMAND: `ssh -i ${process.env["AUR_KEY"]}` }
149+
: {}
150+
151+
await $`git clone ssh://[email protected]/opencode-bin.git ./dist/aur-opencode-bin`.env(
152+
gitEnv,
153+
)
154+
await Bun.file("./dist/aur-opencode-bin/PKGBUILD").write(pkgbuild)
155+
await $`cd ./dist/aur-opencode-bin && makepkg --printsrcinfo > .SRCINFO`
156+
await $`cd ./dist/aur-opencode-bin && git add PKGBUILD .SRCINFO`.env(gitEnv)
157+
await $`cd ./dist/aur-opencode-bin && git commit -m "Update to v${version}"`.env(
158+
gitEnv,
159+
)
160+
if (!dry) await $`cd ./dist/aur-opencode-bin && git push`.env(gitEnv)
119161
}

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.