Skip to content

Commit eee1b1d

Browse files
authored
Merge pull request #4 from FlowingSPDG/feature/add-ci-cd
Add CI/CD workflows for PR checks and automated releases
2 parents 27cfaf8 + fd5fb9a commit eee1b1d

34 files changed

+4131
-908
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- development
8+
push:
9+
branches:
10+
- main
11+
- development
12+
13+
jobs:
14+
test:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: lts/*
23+
cache: 'npm'
24+
25+
- name: Install Rust toolchain
26+
uses: dtolnay/rust-toolchain@stable
27+
with:
28+
components: rustfmt, clippy
29+
30+
- name: Cache Rust build
31+
uses: swatinem/rust-cache@v2
32+
with:
33+
workspaces: './src-tauri -> target'
34+
35+
- name: Install Linux dependencies
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y \
39+
build-essential \
40+
curl \
41+
wget \
42+
file \
43+
pkg-config \
44+
libglib2.0-dev \
45+
libwebkit2gtk-4.1-dev \
46+
libssl-dev \
47+
libayatana-appindicator3-dev \
48+
librsvg2-dev \
49+
patchelf
50+
51+
- name: Set PKG_CONFIG_PATH for Linux
52+
run: |
53+
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV
54+
55+
- name: Install frontend dependencies
56+
run: npm ci
57+
58+
- name: Check Rust formatting
59+
working-directory: src-tauri
60+
run: cargo fmt --all -- --check
61+
62+
- name: Run Clippy
63+
working-directory: src-tauri
64+
run: cargo clippy --all-targets --all-features -- -D warnings
65+
66+
- name: Build Rust code
67+
working-directory: src-tauri
68+
run: cargo build --release --all-features
69+
70+
- name: Run Rust tests
71+
working-directory: src-tauri
72+
run: cargo test --all-features
73+
74+
- name: Build frontend
75+
run: npm run build

.github/workflows/release.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
if: startsWith(github.ref, 'refs/tags/v')
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
include:
18+
- platform: 'ubuntu-latest'
19+
args: ''
20+
- platform: 'windows-latest'
21+
args: ''
22+
- platform: 'macos-latest'
23+
args: ''
24+
25+
runs-on: ${{ matrix.platform }}
26+
27+
steps:
28+
- uses: actions/checkout@v4
29+
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: lts/*
34+
cache: 'npm'
35+
36+
- name: Install Rust toolchain
37+
uses: dtolnay/rust-toolchain@stable
38+
39+
- name: Cache Rust build
40+
uses: swatinem/rust-cache@v2
41+
with:
42+
workspaces: './src-tauri -> target'
43+
44+
- name: Install Linux dependencies
45+
if: matrix.platform == 'ubuntu-latest'
46+
run: |
47+
sudo apt-get update
48+
sudo apt-get install -y \
49+
build-essential \
50+
curl \
51+
wget \
52+
file \
53+
pkg-config \
54+
libglib2.0-dev \
55+
libwebkit2gtk-4.1-dev \
56+
libssl-dev \
57+
libayatana-appindicator3-dev \
58+
librsvg2-dev \
59+
patchelf
60+
# Verify pkg-config can find required libraries
61+
pkg-config --modversion glib-2.0 || echo "ERROR: glib-2.0 not found"
62+
pkg-config --modversion gobject-2.0 || echo "ERROR: gobject-2.0 not found"
63+
pkg-config --modversion gio-2.0 || echo "ERROR: gio-2.0 not found"
64+
65+
- name: Set PKG_CONFIG_PATH for Linux
66+
if: matrix.platform == 'ubuntu-latest'
67+
run: |
68+
echo "PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig:${PKG_CONFIG_PATH}" >> $GITHUB_ENV
69+
70+
- name: Install frontend dependencies
71+
run: npm ci
72+
73+
- name: Build frontend
74+
run: npm run build
75+
76+
- name: Publish Tauri builds
77+
uses: tauri-apps/tauri-action@v0
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
with:
81+
tagName: ${{ github.ref_name }}
82+
releaseName: 'OBS Sync ${{ github.ref_name }}'
83+
releaseBody: '🚀 Release version ${{ github.ref_name }}'
84+
releaseDraft: false
85+
prerelease: false
86+
args: ${{ matrix.args }}

DEVELOPMENT.md

Lines changed: 0 additions & 152 deletions
This file was deleted.

0 commit comments

Comments
 (0)