Skip to content

Commit b94b6f3

Browse files
k0ngk0ngclaude
andcommitted
Add GitHub Actions workflows for CI and release
- CI workflow: Build and test on Node.js 18/20/22, test desktop executor on Linux/macOS/Windows with platform-specific dependencies - Release workflow: Build artifacts for all platforms and create GitHub release on tag push Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 96c7dcf commit b94b6f3

2 files changed

Lines changed: 198 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
node-version: [18, 20, 22]
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js ${{ matrix.node-version }}
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
cache: 'npm'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Build protocol
31+
run: npm run build -w packages/protocol
32+
33+
- name: Build server
34+
run: npm run build -w server
35+
36+
- name: Run tests
37+
run: npm test -w server
38+
39+
build-desktop:
40+
runs-on: ${{ matrix.os }}
41+
42+
strategy:
43+
matrix:
44+
os: [ubuntu-latest, macos-latest, windows-latest]
45+
node-version: [20]
46+
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Node.js ${{ matrix.node-version }}
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: ${{ matrix.node-version }}
55+
cache: 'npm'
56+
57+
# Linux dependencies for robotjs
58+
- name: Install Linux dependencies
59+
if: runner.os == 'Linux'
60+
run: |
61+
sudo apt-get update
62+
sudo apt-get install -y libxtst-dev libpng-dev
63+
64+
# macOS dependencies for robotjs
65+
- name: Install macOS dependencies
66+
if: runner.os == 'macOS'
67+
run: |
68+
xcode-select --install || true
69+
70+
- name: Install dependencies
71+
run: npm ci
72+
73+
- name: Build protocol
74+
run: npm run build -w packages/protocol
75+
76+
- name: Build desktop executor
77+
run: npm run build -w @wire-agent/desktop-executor
78+
79+
lint:
80+
runs-on: ubuntu-latest
81+
82+
steps:
83+
- name: Checkout repository
84+
uses: actions/checkout@v4
85+
86+
- name: Setup Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version: 20
90+
cache: 'npm'
91+
92+
- name: Install dependencies
93+
run: npm ci
94+
95+
- name: Check TypeScript
96+
run: |
97+
npm run build -w packages/protocol
98+
npm run build -w server

.github/workflows/release.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build-and-release:
13+
runs-on: ${{ matrix.os }}
14+
15+
strategy:
16+
matrix:
17+
include:
18+
- os: ubuntu-latest
19+
platform: linux
20+
- os: macos-latest
21+
platform: macos
22+
- os: windows-latest
23+
platform: windows
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v4
31+
with:
32+
node-version: 20
33+
cache: 'npm'
34+
35+
# Linux dependencies for robotjs
36+
- name: Install Linux dependencies
37+
if: runner.os == 'Linux'
38+
run: |
39+
sudo apt-get update
40+
sudo apt-get install -y libxtst-dev libpng-dev
41+
42+
- name: Install dependencies
43+
run: npm ci
44+
45+
- name: Build all
46+
run: npm run build
47+
48+
# Package server
49+
- name: Package server
50+
run: |
51+
mkdir -p dist/server
52+
cp -r server/dist dist/server/
53+
cp server/package.json dist/server/
54+
55+
# Package desktop executor
56+
- name: Package desktop executor
57+
run: |
58+
mkdir -p dist/desktop
59+
cp -r executors/desktop/dist dist/desktop/
60+
cp executors/desktop/package.json dist/desktop/
61+
62+
# Create archive
63+
- name: Create archive (Unix)
64+
if: runner.os != 'Windows'
65+
run: |
66+
cd dist
67+
tar -czvf wire-agent-${{ matrix.platform }}.tar.gz server desktop
68+
69+
- name: Create archive (Windows)
70+
if: runner.os == 'Windows'
71+
run: |
72+
cd dist
73+
Compress-Archive -Path server, desktop -DestinationPath wire-agent-${{ matrix.platform }}.zip
74+
75+
# Upload artifacts
76+
- name: Upload artifacts
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: wire-agent-${{ matrix.platform }}
80+
path: |
81+
dist/wire-agent-*.tar.gz
82+
dist/wire-agent-*.zip
83+
84+
create-release:
85+
needs: build-and-release
86+
runs-on: ubuntu-latest
87+
88+
steps:
89+
- name: Download all artifacts
90+
uses: actions/download-artifact@v4
91+
with:
92+
path: artifacts
93+
94+
- name: Create Release
95+
uses: softprops/action-gh-release@v1
96+
with:
97+
files: |
98+
artifacts/**/*.tar.gz
99+
artifacts/**/*.zip
100+
generate_release_notes: true

0 commit comments

Comments
 (0)