77 paths :
88 - ' package.json'
99 - ' src-tauri/tauri.conf.json'
10+ workflow_dispatch :
11+ inputs :
12+ force_release :
13+ description : ' Force a release even if version has not changed'
14+ type : boolean
15+ default : false
1016
1117jobs :
1218 check-version :
3844 echo "Previous version: $PREVIOUS_VERSION"
3945
4046 # Determine if we should create a release
41- if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ]; then
42- echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION"
47+ if [ "$CURRENT_VERSION" != "$PREVIOUS_VERSION" ] || ${{ github.event.inputs.force_release == 'true' }} ; then
48+ echo "Version changed from $PREVIOUS_VERSION to $CURRENT_VERSION or force_release is true "
4349 echo "should_release=true" >> $GITHUB_OUTPUT
4450 echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
4551 echo "previous_version=$PREVIOUS_VERSION" >> $GITHUB_OUTPUT
@@ -48,113 +54,17 @@ jobs:
4854 echo "should_release=false" >> $GITHUB_OUTPUT
4955 fi
5056
51- build-macos :
57+ build :
5258 needs : check-version
5359 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@v4
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@v4
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@v4
151- # with:
152- # name: circle-camera-windows
153- # path: src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi
60+ uses : ./.github/workflows/build.yml
61+ with :
62+ version : ${{ needs.check-version.outputs.version }}
63+ should_build : true
15464
15565 create-release :
156- needs : [check-version, build-macos ]
157- # Remove build-windows from dependencies since Windows is not supported
66+ needs : [check-version, build]
67+ if : needs.check-version.outputs.should_release == 'true'
15868 runs-on : ubuntu-latest
15969 steps :
16070 - name : Checkout repository
@@ -244,8 +154,6 @@ jobs:
244154 asset_name : Circle.Camera_${{ needs.check-version.outputs.version }}_x64.dmg
245155 asset_content_type : application/octet-stream
246156
247- # Windows asset upload is removed as it's not supported
248-
249157 - name : Upload latest.json Asset
250158 uses : actions/upload-release-asset@v1
251159 env :
0 commit comments