GeezerVison is showing github.com — ci · drwebb/opencode@52ef8de
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: .github/workflows/publish.yml +13-4Lines changed: 13 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,10 @@ name: publish |
2 | 2 | run-name: "${{ format('release {0}', inputs.bump) }}" |
3 | 3 |
|
4 | 4 | on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - dev |
| 8 | + - snapshot-* |
5 | 9 | workflow_dispatch: |
6 | 10 | inputs: |
7 | 11 | bump: |
|
46 | 50 | run: | |
47 | 51 | sudo apt-get update |
48 | 52 | sudo apt-get install -y pacman-package-manager |
| 53 | +
|
49 | 54 | - name: Setup SSH for AUR |
50 | 55 | run: | |
51 | 56 | mkdir -p ~/.ssh |
@@ -69,17 +74,21 @@ jobs: |
69 | 74 | username: ${{ github.repository_owner }} |
70 | 75 | password: ${{ secrets.GITHUB_TOKEN }} |
71 | 76 |
|
| 77 | + - uses: actions/setup-node@v4 |
| 78 | + with: |
| 79 | + node-version: "24" |
| 80 | + registry-url: "https://registry.npmjs.org" |
| 81 | + |
72 | 82 | - name: Publish |
73 | 83 | run: | |
74 | 84 | ./script/publish.ts |
75 | 85 | env: |
76 | 86 | OPENCODE_BUMP: ${{ inputs.bump }} |
77 | 87 | OPENCODE_VERSION: ${{ inputs.version }} |
78 | | - OPENCODE_CHANNEL: latest |
79 | | - NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }} |
80 | | - GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} |
81 | | - AUR_KEY: ${{ secrets.AUR_KEY }} |
82 | 88 | OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }} |
| 89 | + AUR_KEY: ${{ secrets.AUR_KEY }} |
| 90 | + GITHUB_TOKEN: ${{ secrets.SST_GITHUB_TOKEN }} |
| 91 | + NPM_CONFIG_PROVENANCE: false |
83 | 92 |
|
84 | 93 | publish-tauri: |
85 | 94 | continue-on-error: true |
|
Collapse file
Copy file name to clipboardExpand all lines: packages/script/src/index.ts +7-1Lines changed: 7 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,8 +13,14 @@ if (process.versions.bun !== expectedBunVersion) { |
13 | 13 | throw new Error(`This script requires bun@${expectedBunVersion}, but you are using bun@${process.versions.bun}`) |
14 | 14 | } |
15 | 15 |
|
16 | | -const CHANNEL = process.env["OPENCODE_CHANNEL"] ?? (await $`git branch --show-current`.text().then((x) => x.trim())) |
| 16 | +const CHANNEL = await (async () => { |
| 17 | + if (process.env["OPENCODE_CHANNEL"]) return process.env["OPENCODE_CHANNEL"] |
| 18 | + if (process.env["OPENCODE_BUMP"]) return "latest" |
| 19 | + if (!process.env["OPENCODE_VERSION"]?.startsWith("0.0.0-")) return "latest" |
| 20 | + return await $`git branch --show-current`.text().then((x) => x.trim()) |
| 21 | +})() |
17 | 22 | const IS_PREVIEW = CHANNEL !== "latest" |
| 23 | + |
18 | 24 | const VERSION = await (async () => { |
19 | 25 | if (process.env["OPENCODE_VERSION"]) return process.env["OPENCODE_VERSION"] |
20 | 26 | if (IS_PREVIEW) return `0.0.0-${CHANNEL}-${new Date().toISOString().slice(0, 16).replace(/[-:T]/g, "")}` |
|