Skip to content

Commit fdc45dc

Browse files
tinmancodingopencode
andcommitted
feat: implement comprehensive CI/CD pipeline and release automation
Add GitHub Actions workflows for quality checks and automated releases, cross-platform build scripts, installation script, and supporting documentation for streamlined development and distribution workflow. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
1 parent 73c1bf3 commit fdc45dc

7 files changed

Lines changed: 704 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
quality-checks:
11+
name: Quality Checks
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Install devbox
19+
uses: jetify-com/devbox-install-action@v0.12.0
20+
with:
21+
enable-cache: true
22+
23+
- name: Lint check
24+
run: devbox run lint
25+
26+
- name: Type check
27+
run: devbox run type-check
28+
29+
- name: Unit tests
30+
run: devbox run test:unit
31+
32+
- name: Integration tests
33+
run: devbox run test:integration
34+
35+
- name: Build verification
36+
run: devbox run build
37+
38+
cross-platform-test:
39+
name: Cross-Platform Integration Tests
40+
strategy:
41+
matrix:
42+
os: [ubuntu-latest, macos-latest]
43+
runs-on: ${{ matrix.os }}
44+
45+
steps:
46+
- name: Checkout code
47+
uses: actions/checkout@v4
48+
49+
- name: Install devbox
50+
uses: jetify-com/devbox-install-action@v0.12.0
51+
with:
52+
enable-cache: true
53+
54+
- name: Integration tests
55+
run: devbox run test:integration

.github/workflows/release.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to release (e.g., v1.2.3)'
11+
required: true
12+
type: string
13+
prerelease:
14+
description: 'Mark as pre-release'
15+
required: false
16+
type: boolean
17+
default: false
18+
19+
permissions:
20+
contents: write
21+
actions: read
22+
23+
jobs:
24+
build:
25+
name: Build Cross-Platform Binaries
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Install devbox
33+
uses: jetify-com/devbox-install-action@v0.12.0
34+
with:
35+
enable-cache: true
36+
37+
- name: Run quality checks
38+
run: |
39+
devbox run lint
40+
devbox run type-check
41+
devbox run test
42+
43+
- name: Create dist directory
44+
run: mkdir -p dist
45+
46+
- name: Build all platforms
47+
run: devbox run build:all
48+
49+
- name: Generate checksums
50+
run: |
51+
cd dist
52+
sha256sum wt-* > checksums.txt
53+
54+
- name: Upload build artifacts
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: binaries
58+
path: |
59+
dist/wt-*
60+
dist/checksums.txt
61+
62+
release:
63+
name: Create GitHub Release
64+
needs: build
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- name: Checkout code
69+
uses: actions/checkout@v4
70+
71+
- name: Download build artifacts
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: binaries
75+
path: dist/
76+
77+
- name: Determine version
78+
id: version
79+
run: |
80+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
81+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
82+
echo "prerelease=${{ github.event.inputs.prerelease }}" >> $GITHUB_OUTPUT
83+
else
84+
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
85+
echo "prerelease=false" >> $GITHUB_OUTPUT
86+
fi
87+
88+
- name: Create release archives
89+
run: |
90+
cd dist
91+
for binary in wt-linux-x64 wt-linux-arm64 wt-darwin-x64 wt-darwin-arm64; do
92+
if [ -f "$binary" ]; then
93+
if [[ "$binary" == *"darwin"* ]]; then
94+
zip "${binary}.zip" "$binary"
95+
else
96+
tar -czf "${binary}.tar.gz" "$binary"
97+
fi
98+
fi
99+
done
100+
101+
- name: Generate release notes
102+
id: release_notes
103+
run: |
104+
echo "## What's Changed" > release_notes.md
105+
echo "" >> release_notes.md
106+
echo "### Binaries" >> release_notes.md
107+
echo "" >> release_notes.md
108+
echo "| Platform | Architecture | Download |" >> release_notes.md
109+
echo "|----------|-------------|----------|" >> release_notes.md
110+
echo "| Linux | x64 | [wt-linux-x64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/wt-linux-x64.tar.gz) |" >> release_notes.md
111+
echo "| Linux | ARM64 | [wt-linux-arm64.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/wt-linux-arm64.tar.gz) |" >> release_notes.md
112+
echo "| macOS | x64 (Intel) | [wt-darwin-x64.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/wt-darwin-x64.zip) |" >> release_notes.md
113+
echo "| macOS | ARM64 (Apple Silicon) | [wt-darwin-arm64.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/wt-darwin-arm64.zip) |" >> release_notes.md
114+
echo "" >> release_notes.md
115+
echo "### Installation" >> release_notes.md
116+
echo "" >> release_notes.md
117+
echo '```bash' >> release_notes.md
118+
echo "# Quick install (latest version)" >> release_notes.md
119+
echo "curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | sh" >> release_notes.md
120+
echo "" >> release_notes.md
121+
echo "# Install specific version" >> release_notes.md
122+
echo "WT_INSTALL_VERSION=${{ steps.version.outputs.version }} curl -fsSL https://raw.githubusercontent.com/${{ github.repository }}/main/install.sh | sh" >> release_notes.md
123+
echo '```' >> release_notes.md
124+
echo "" >> release_notes.md
125+
echo "### Verification" >> release_notes.md
126+
echo "" >> release_notes.md
127+
echo "All binaries include SHA256 checksums for verification. Download [checksums.txt](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/checksums.txt) to verify your download." >> release_notes.md
128+
129+
- name: Create GitHub Release
130+
uses: softprops/action-gh-release@v2
131+
with:
132+
tag_name: ${{ steps.version.outputs.version }}
133+
name: Release ${{ steps.version.outputs.version }}
134+
body_path: release_notes.md
135+
prerelease: ${{ steps.version.outputs.prerelease }}
136+
files: |
137+
dist/wt-*.tar.gz
138+
dist/wt-*.zip
139+
dist/checksums.txt
140+
generate_release_notes: true

0 commit comments

Comments
 (0)