Skip to content

Commit 5aa8d68

Browse files
authored
Devbyray/issue6 (#14)
* feat: #6 implemented basic update meganism with Tauri * feat: #6 add update overlay component and integrate update handling in WebcamContainer * fix: #6 dynamically determine development mode for update simulation * feat: #6 enhance UpdateChecker component with simulated update version generation and improved TypeScript typing * feat: #6 add .env.example for environment variable configuration and update .gitignore to include .env file refactor: update UpdateChecker to allow environment variable override for development mode refactor: clean up imports in UpdateOverlay and IconLibrary components * feat: #6 add GitHub Actions workflow for automated build and release process * feat: enhance GitHub Actions workflow with Rust toolchain installation and caching for PNPM * feat: remove Windows build steps and assets from release workflow as Windows is not officially supported * chore(release): 0.2.1 * feat: add release process documentation for Circle Camera app * Implement code changes to enhance functionality and improve performance * fix: revert version number to 0.2.0 in package.json * Refactor code structure for improved readability and maintainability * Release 0.3.0 * chore: update version number to 0.3.0 in tauri.conf.json
1 parent b5a106d commit 5aa8d68

22 files changed

Lines changed: 4199 additions & 203 deletions

.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Example environment variables for Circle Camera
2+
3+
# Force update development mode regardless of environment
4+
# Set to "true" to always use simulated updates
5+
# Set to "false" to always use real update system
6+
# Uncomment one of the following lines to enable:
7+
# VITE_FORCE_UPDATE_DEV_MODE=true
8+
# VITE_FORCE_UPDATE_DEV_MODE=false
9+
10+
# Update endpoint for testing (optional)
11+
# VITE_UPDATE_ENDPOINT=http://localhost:8080/latest.json

.github/workflows/release.yml

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'package.json'
9+
- 'src-tauri/tauri.conf.json'
10+
11+
jobs:
12+
check-version:
13+
runs-on: ubuntu-latest
14+
outputs:
15+
should_release: ${{ steps.check.outputs.should_release }}
16+
version: ${{ steps.check.outputs.version }}
17+
previous_version: ${{ steps.check.outputs.previous_version }}
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 2
23+
24+
- name: Check version changes
25+
id: check
26+
run: |
27+
git diff HEAD^ HEAD --name-only
28+
29+
# Get current version from package.json
30+
CURRENT_VERSION=$(node -p "require('./package.json').version")
31+
32+
# Get previous commit's package.json version
33+
git checkout HEAD~1 package.json
34+
PREVIOUS_VERSION=$(node -p "require('./package.json').version")
35+
git checkout HEAD package.json
36+
37+
echo "Current version: $CURRENT_VERSION"
38+
echo "Previous version: $PREVIOUS_VERSION"
39+
40+
# Determine if we should create a release
41+
if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
42+
echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION"
43+
echo "should_release=true" >> $GITHUB_OUTPUT
44+
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
45+
echo "previous_version=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT
46+
else
47+
echo "No version change detected"
48+
echo "should_release=false" >> $GITHUB_OUTPUT
49+
fi
50+
51+
build-macos:
52+
needs: check-version
53+
if: needs.check-version.outputs.should_release == 'true'
54+
runs-on: macos-latest
55+
steps:
56+
- name: Checkout repository
57+
uses: actions/checkout@v4
58+
59+
- name: Setup Node.js
60+
uses: actions/setup-node@v4
61+
with:
62+
node-version: '18'
63+
cache: 'pnpm'
64+
65+
- name: Install Rust stable
66+
uses: dtolnay/rust-toolchain@stable
67+
with:
68+
components: rustfmt, clippy
69+
targets: aarch64-apple-darwin,x86_64-apple-darwin
70+
71+
- name: Install additional dependencies
72+
run: |
73+
rustup target add aarch64-apple-darwin x86_64-apple-darwin
74+
rustup default stable
75+
rustup show
76+
cargo --version
77+
78+
- name: Install PNPM
79+
uses: pnpm/action-setup@v3
80+
with:
81+
version: 8
82+
83+
- name: Install dependencies
84+
run: pnpm install
85+
86+
- name: Build for macOS (Apple Silicon)
87+
run: pnpm tauri build --target aarch64-apple-darwin
88+
89+
- name: Build for macOS (Intel)
90+
run: pnpm tauri build --target x86_64-apple-darwin
91+
92+
- name: Upload macOS (Apple Silicon) Artifact
93+
uses: actions/upload-artifact@v3
94+
with:
95+
name: circle-camera-macos-aarch64
96+
path: src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg
97+
98+
- name: Upload macOS (Intel) Artifact
99+
uses: actions/upload-artifact@v3
100+
with:
101+
name: circle-camera-macos-x64
102+
path: src-tauri/target/x86_64-apple-darwin/release/bundle/dmg/*.dmg
103+
104+
# Windows build is commented out as Windows is not officially supported
105+
# build-windows:
106+
# needs: check-version
107+
# if: needs.check-version.outputs.should_release == 'true'
108+
# runs-on: windows-latest
109+
# steps:
110+
# - name: Checkout repository
111+
# uses: actions/checkout@v4
112+
#
113+
# - name: Setup Node.js
114+
# uses: actions/setup-node@v4
115+
# with:
116+
# node-version: '18'
117+
# cache: 'pnpm'
118+
#
119+
# - name: Install Rust stable
120+
# uses: dtolnay/rust-toolchain@stable
121+
# with:
122+
# components: rustfmt, clippy
123+
# targets: x86_64-pc-windows-msvc
124+
#
125+
# - name: Install additional dependencies
126+
# run: |
127+
# rustup target add x86_64-pc-windows-msvc
128+
# rustup default stable
129+
# rustup show
130+
# cargo --version
131+
#
132+
# - name: Install PNPM
133+
# uses: pnpm/action-setup@v3
134+
# with:
135+
# version: 8
136+
#
137+
# - name: Install dependencies
138+
# run: pnpm install
139+
#
140+
# - name: Install Windows WebView2
141+
# run: |
142+
# $ProgressPreference = 'SilentlyContinue'
143+
# Invoke-WebRequest "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -OutFile "MicrosoftEdgeWebview2Setup.exe"
144+
# Start-Process -FilePath "MicrosoftEdgeWebview2Setup.exe" -Args "/silent /install" -Verb RunAs -Wait
145+
#
146+
# - name: Build for Windows
147+
# run: pnpm tauri build --target x86_64-pc-windows-msvc
148+
#
149+
# - name: Upload Windows Artifact
150+
# uses: actions/upload-artifact@v3
151+
# with:
152+
# name: circle-camera-windows
153+
# path: src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi
154+
155+
create-release:
156+
needs: [check-version, build-macos]
157+
# Remove build-windows from dependencies since Windows is not supported
158+
runs-on: ubuntu-latest
159+
steps:
160+
- name: Checkout repository
161+
uses: actions/checkout@v4
162+
163+
- name: Setup Node.js
164+
uses: actions/setup-node@v4
165+
with:
166+
node-version: '18'
167+
cache: 'pnpm'
168+
169+
- name: Install PNPM
170+
uses: pnpm/action-setup@v3
171+
with:
172+
version: 8
173+
174+
- name: Install dependencies
175+
run: pnpm install
176+
177+
- name: Download all artifacts
178+
uses: actions/download-artifact@v3
179+
with:
180+
path: artifacts
181+
182+
- name: List all artifacts
183+
run: ls -la artifacts/*
184+
185+
- name: Generate update JSON
186+
run: |
187+
mkdir -p release-assets
188+
cp artifacts/circle-camera-macos-aarch64/*.dmg release-assets/
189+
cp artifacts/circle-camera-macos-x64/*.dmg release-assets/
190+
# Windows asset copy is removed as it's not supported
191+
192+
# Generate latest.json
193+
node ./scripts/generate-update-json.js
194+
cp latest.json release-assets/
195+
196+
- name: Create Draft Release
197+
id: create_release
198+
uses: actions/create-release@v1
199+
env:
200+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
201+
with:
202+
tag_name: v${{ needs.check-version.outputs.version }}
203+
release_name: Circle Camera v${{ needs.check-version.outputs.version }}
204+
draft: true
205+
prerelease: false
206+
body: |
207+
# Circle Camera ${{ needs.check-version.outputs.version }}
208+
209+
Automated release from version ${{ needs.check-version.outputs.previous_version }} to ${{ needs.check-version.outputs.version }}
210+
211+
## Platform Support
212+
213+
Circle Camera is officially supported on macOS only (both Intel and Apple Silicon).
214+
Windows is not officially supported at this time.
215+
216+
## How to Test This Release
217+
218+
1. Download the appropriate installer for your platform
219+
2. Install the application
220+
3. Verify that the app works as expected
221+
4. Test the automatic update system
222+
223+
## Changelog
224+
225+
*Please add your changelog here before publishing the release*
226+
227+
- name: Upload macOS Apple Silicon Asset
228+
uses: actions/upload-release-asset@v1
229+
env:
230+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
231+
with:
232+
upload_url: ${{ steps.create_release.outputs.upload_url }}
233+
asset_path: ./release-assets/Circle.Camera_${{ needs.check-version.outputs.version }}_aarch64.dmg
234+
asset_name: Circle.Camera_${{ needs.check-version.outputs.version }}_aarch64.dmg
235+
asset_content_type: application/octet-stream
236+
237+
- name: Upload macOS Intel Asset
238+
uses: actions/upload-release-asset@v1
239+
env:
240+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
241+
with:
242+
upload_url: ${{ steps.create_release.outputs.upload_url }}
243+
asset_path: ./release-assets/Circle.Camera_${{ needs.check-version.outputs.version }}_x64.dmg
244+
asset_name: Circle.Camera_${{ needs.check-version.outputs.version }}_x64.dmg
245+
asset_content_type: application/octet-stream
246+
247+
# Windows asset upload is removed as it's not supported
248+
249+
- name: Upload latest.json Asset
250+
uses: actions/upload-release-asset@v1
251+
env:
252+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253+
with:
254+
upload_url: ${{ steps.create_release.outputs.upload_url }}
255+
asset_path: ./release-assets/latest.json
256+
asset_name: latest.json
257+
asset_content_type: application/json

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ dist-ssr
2727
*.sln
2828
*.sw?
2929
docs/.vitepress/cache
30+
.env

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
### 0.2.1 (2025-04-17)
6+
7+
8+
### Features
9+
10+
* [#6](https://github.com/devbyray/circle-camera/issues/6) add .env.example for environment variable configuration and update .gitignore to include .env file ([8df4497](https://github.com/devbyray/circle-camera/commit/8df44971c15c050f6125d3c5854ff60e3a94bb80))
11+
* [#6](https://github.com/devbyray/circle-camera/issues/6) add GitHub Actions workflow for automated build and release process ([f4f1fff](https://github.com/devbyray/circle-camera/commit/f4f1fff2e1215ff31ec079d0f397f23a6662a474))
12+
* [#6](https://github.com/devbyray/circle-camera/issues/6) add update overlay component and integrate update handling in WebcamContainer ([dd57510](https://github.com/devbyray/circle-camera/commit/dd57510c819fc39f2a47011ce29038bc5add3dcb))
13+
* [#6](https://github.com/devbyray/circle-camera/issues/6) enhance UpdateChecker component with simulated update version generation and improved TypeScript typing ([ea18f34](https://github.com/devbyray/circle-camera/commit/ea18f340551b9bc0252be39f541bdf6a697415a8))
14+
* [#6](https://github.com/devbyray/circle-camera/issues/6) implemented basic update meganism with Tauri ([5e32c82](https://github.com/devbyray/circle-camera/commit/5e32c82de3674d7002ba18921ede229e68d2b84f))
15+
* add window drag functionality and close command integration ([5b47e1e](https://github.com/devbyray/circle-camera/commit/5b47e1e5b1a28cd3371b41f68cb8cdd9484eb5e4))
16+
* enhance documentation and setup instructions for Windows and MacOS; add Product Hunt links and recommendations ([d934943](https://github.com/devbyray/circle-camera/commit/d934943acf5bff6251dfb79d8f1db53a00b4d20c))
17+
* enhance GitHub Actions workflow with Rust toolchain installation and caching for PNPM ([a301773](https://github.com/devbyray/circle-camera/commit/a301773cb6b6df010d41c904d75b4812ff553191))
18+
* enhance window drag functionality and update permissions in configuration ([ee8bec2](https://github.com/devbyray/circle-camera/commit/ee8bec2dd24e707ea8a01d98220497ce65326d89))
19+
* initialize Circle Camera Tauri application with camera access ([bf3e2cf](https://github.com/devbyray/circle-camera/commit/bf3e2cfcaed5bc9bf966fc01d3a74508ceb584a4))
20+
* initialize Circle Camera Tauri application with camera functionality ([f46adb5](https://github.com/devbyray/circle-camera/commit/f46adb57e8eafeb646af097ba2394ea24e696da5))
21+
* remove Windows build steps and assets from release workflow as Windows is not officially supported ([5123e92](https://github.com/devbyray/circle-camera/commit/5123e9247a032e440eda2878967ab6505fcfcc9c))
22+
* update .gitignore to include installers directory and enhance README with installation and development instructions ([6e2c996](https://github.com/devbyray/circle-camera/commit/6e2c9965651d965be47e4fbc36b348147ff8cf85))
23+
* update download section with version 0.2.0 and new DMG link ([#9](https://github.com/devbyray/circle-camera/issues/9)) ([433bd74](https://github.com/devbyray/circle-camera/commit/433bd74afa60cf26e53cf4e48462ccbaeb0e7c85))
24+
* update license to EUPL and add Vercel analytics integration ([#1](https://github.com/devbyray/circle-camera/issues/1)) ([ce24ab0](https://github.com/devbyray/circle-camera/commit/ce24ab055054c266d6e6cf8fe0e7b693537e1052))
25+
26+
27+
### Bug Fixes
28+
29+
* [#6](https://github.com/devbyray/circle-camera/issues/6) dynamically determine development mode for update simulation ([5c9837a](https://github.com/devbyray/circle-camera/commit/5c9837ac4f057c74438f40717a14f8669ed3d54e))
30+
* correct image path in features documentation ([5ee911d](https://github.com/devbyray/circle-camera/commit/5ee911d46b75b4eb924da1eda8f7cd4990cf4f5f))

0 commit comments

Comments
 (0)