Skip to content

Commit 54edc4e

Browse files
committed
ci test
1 parent 60d159a commit 54edc4e

File tree

5 files changed

+148
-19
lines changed

5 files changed

+148
-19
lines changed

.github/workflows/build.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: build
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- dev
8+
9+
concurrency: ${{ github.workflow }}-${{ github.ref }}
10+
11+
permissions:
12+
contents: write
13+
packages: write
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- uses: oven-sh/setup-bun@v1
23+
with:
24+
bun-version: latest
25+
26+
- run: |
27+
npm config set //registry.npmjs.org/:_authToken $NODE_AUTH_TOKEN
28+
npm whoami
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
32+
- run: git fetch --force --tags
33+
34+
- uses: actions/setup-go@v5
35+
with:
36+
go-version: ">=1.23.2"
37+
38+
- name: Go Mod
39+
run: go mod download
40+
41+
# TODO remove temporary workaround
42+
- run: bun i --frozen-lockfile
43+
- run: git reset --hard
44+
- run: cd platform && bun tsc --noEmit
45+
- run: ./platform/scripts/build
46+
- uses: goreleaser/goreleaser-action@v6
47+
with:
48+
distribution: goreleaser
49+
version: latest
50+
args: build --snapshot --clean

.github/workflows/release.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: release
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- opencode
8+
tags:
9+
- "*"
10+
11+
concurrency: ${{ github.workflow }}-${{ github.ref }}
12+
13+
permissions:
14+
contents: write
15+
packages: write
16+
17+
jobs:
18+
goreleaser:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v3
22+
with:
23+
fetch-depth: 0
24+
25+
- run: git fetch --force --tags
26+
27+
- uses: actions/setup-go@v5
28+
with:
29+
go-version: ">=1.23.2"
30+
31+
- run: go mod download
32+
- uses: goreleaser/goreleaser-action@v6
33+
with:
34+
distribution: goreleaser
35+
version: latest
36+
args: release --clean
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
AUR_KEY: ${{ secrets.AUR_KEY }}

.goreleaser.yml

+9-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
version: 2
2-
project_name: sst
2+
project_name: opencode
33
before:
44
hooks:
5-
- go mod tidy
6-
- go test ./cmd/... ./pkg/...
75
builds:
86
- env:
97
- CGO_ENABLED=0
108
goos:
119
- linux
1210
- darwin
13-
main: ./cmd/sst
11+
main: ./main.go
1412

1513
archives:
1614
- format: tar.gz
1715
# this name template makes the OS and Arch compatible with the results of uname.
1816
name_template: >-
19-
sst-
17+
opencode-
2018
{{- if eq .Os "darwin" }}mac-
2119
{{- else if eq .Os "windows" }}windows-
2220
{{- else if eq .Os "linux" }}linux-{{end}}
@@ -33,20 +31,20 @@ checksum:
3331
snapshot:
3432
name_template: "0.0.0-{{ .Timestamp }}"
3533
aurs:
36-
- homepage: "https://github.com/sst/sst"
34+
- homepage: "https://github.com/opencode-ai/opencode"
3735
description: "Deploy anything"
3836
private_key: "{{ .Env.AUR_KEY }}"
39-
git_url: "ssh://[email protected]/sst-bin.git"
37+
git_url: "ssh://[email protected]/opencode.git"
4038
license: "MIT"
4139
package: |-
42-
install -Dm755 ./sst "${pkgdir}/usr/bin/sst"
40+
install -Dm755 ./opencode "${pkgdir}/usr/bin/opencode"
4341
brews:
4442
- repository:
45-
owner: sst
43+
owner: opencode-ai
4644
name: homebrew-tap
4745
nfpms:
48-
- maintainer: sst
49-
description: the sst cli
46+
- maintainer: opencode
47+
description: terminal based agent that can build anything
5048
formats:
5149
- deb
5250
- rpm
@@ -55,14 +53,6 @@ nfpms:
5553
{{- if eq .Os "darwin" }}mac
5654
{{- else }}{{ .Os }}{{ end }}-{{ .Arch }}
5755
58-
# scoop:
59-
# bucket:
60-
# owner: sst
61-
# name: scoop-bucket
62-
# homepage: "https://github.com/sst/ion"
63-
# description: "sst cli"
64-
# license: Apache 2.0
65-
6656
changelog:
6757
sort: asc
6858
filters:

scripts/release

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env bash
2+
3+
# Parse command line arguments
4+
minor=false
5+
while [ "$#" -gt 0 ]; do
6+
case "$1" in
7+
--minor) minor=true; shift 1;;
8+
*) echo "Unknown parameter: $1"; exit 1;;
9+
esac
10+
done
11+
12+
git fetch --force --tags
13+
14+
# Get the latest Git tag
15+
latest_tag=$(git tag --sort=committerdate | grep -E '[0-9]' | tail -1)
16+
17+
# If there is no tag, exit the script
18+
if [ -z "$latest_tag" ]; then
19+
echo "No tags found"
20+
exit 1
21+
fi
22+
23+
echo "Latest tag: $latest_tag"
24+
25+
# Split the tag into major, minor, and patch numbers
26+
IFS='.' read -ra VERSION <<< "$latest_tag"
27+
28+
if [ "$minor" = true ]; then
29+
# Increment the minor version and reset patch to 0
30+
minor_number=${VERSION[1]}
31+
let "minor_number++"
32+
new_version="${VERSION[0]}.$minor_number.0"
33+
else
34+
# Increment the patch version
35+
patch_number=${VERSION[2]}
36+
let "patch_number++"
37+
new_version="${VERSION[0]}.${VERSION[1]}.$patch_number"
38+
fi
39+
40+
echo "New version: $new_version"
41+
42+
git tag $new_version
43+
git push --tags

scripts/snapshot

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
export DOCKER_PUSH=true
4+
./platform/scripts/build
5+
goreleaser build --clean --snapshot --skip validate
6+
cd sdk/js
7+
bun run release

0 commit comments

Comments
 (0)