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 — ci: bump version · karnagge/codechico@1437a0a

File tree

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

‎.github/workflows/format.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/format.yml
+4-5Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ jobs:
2020
with:
2121
bun-version: 1.2.21
2222

23-
- name: Install dependencies
24-
run: bun install
25-
26-
- name: Run format
27-
run: ./script/format.ts
23+
- name: run
24+
run: |
25+
bun install
26+
./script/format.ts
2827
env:
2928
CI: true
Collapse file

‎.github/workflows/publish.yml‎

Copy file name to clipboardExpand all lines: .github/workflows/publish.yml
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ run-name: "${{ format('v{0}', inputs.version) }}"
44
on:
55
workflow_dispatch:
66
inputs:
7-
version:
8-
description: "Version to publish"
7+
bump:
8+
description: "Bump major, minor, or patch"
99
required: true
10-
type: string
11-
title:
12-
description: "Custom title for this run"
13-
required: false
14-
type: string
10+
type: choice
11+
options:
12+
- major
13+
- minor
14+
- patch
1515

1616
concurrency: ${{ github.workflow }}-${{ github.ref }}
1717

@@ -65,8 +65,9 @@ jobs:
6565

6666
- name: Publish
6767
run: |
68-
OPENCODE_VERSION=${{ inputs.version }} ./script/publish.ts
68+
./script/publish.ts
6969
env:
70+
OPENCODE_BUMP: ${{ inputs.bump }}
7071
GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }}
7172
AUR_KEY: ${{ secrets.AUR_KEY }}
7273
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
Collapse file

‎script/publish.ts‎

Copy file name to clipboardExpand all lines: script/publish.ts
+12-6Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,18 @@ if (process.versions.bun !== "1.2.21") {
99
console.log("=== publishing ===\n")
1010

1111
const snapshot = process.env["OPENCODE_SNAPSHOT"] === "true"
12-
const version = snapshot
13-
? `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
14-
: process.env["OPENCODE_VERSION"]
15-
if (!version) {
16-
throw new Error("OPENCODE_VERSION is required")
17-
}
12+
const version = await (async () => {
13+
if (snapshot) return `0.0.0-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}`
14+
const [major, minor, patch] = (await $`gh release list --limit 1 --json tagName --jq '.[0].tagName'`.text())
15+
.trim()
16+
.replace(/^v/, "")
17+
.split(".")
18+
.map((x) => Number(x) || 0)
19+
const t = process.env["OPENCODE_BUMP"]?.toLowerCase()
20+
if (t === "major") return `${major + 1}.0.0`
21+
if (t === "minor") return `${major}.${minor + 1}.0`
22+
return `${major}.${minor}.${patch + 1}`
23+
})()
1824
process.env["OPENCODE_VERSION"] = version
1925
console.log("version:", version)
2026

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.