Skip to content

Commit bb7dd6b

Browse files
fix: build error on windows platform with cargo add git repo (#727)
Co-authored-by: hardy <[email protected]>
1 parent 37c5f2d commit bb7dd6b

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ jobs:
5757
steps:
5858
- name: Checkout repository
5959
uses: actions/checkout@v4
60+
61+
- name: Checkout dependency repository
62+
uses: actions/checkout@v4
63+
with:
64+
repository: 'infinilabs/pizza'
65+
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
66+
submodules: recursive
67+
ref: main
68+
path: pizza
69+
6070
- name: Setup node
6171
uses: actions/setup-node@v4
6272
with:
@@ -65,18 +75,21 @@ jobs:
6575
with:
6676
version: latest
6777

68-
- name: Install rust target
69-
if: matrix.target == 'i686-pc-windows-msvc'
70-
run: rustup target add ${{ matrix.target }}
71-
7278
- name: Install dependencies (ubuntu only)
7379
if: startsWith(matrix.platform, 'ubuntu-22.04')
7480
run: |
7581
sudo apt-get update
7682
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf xdg-utils
7783
78-
- name: Install Rust stable
79-
run: rustup toolchain install stable
84+
- name: Add pizza engine as a dependency
85+
working-directory: src-tauri
86+
run: |
87+
if [[ "${{matrix.target }}" != "i686-pc-windows-msvc" ]]; then
88+
echo "Adding pizza engine as a dependency for ${{matrix.platform }}-${{matrix.target }}"
89+
( cargo add --path ../../pizza/lib/engine --features query_string_parser,persistence )
90+
else
91+
echo "Skipping pizza engine dependency for ${{matrix.platform }}-${{matrix.target }}"
92+
fi
8093
8194
- name: Rust cache
8295
uses: swatinem/rust-cache@v2
@@ -92,25 +105,11 @@ jobs:
92105
- name: Install app dependencies and build web
93106
run: pnpm install --frozen-lockfile
94107

95-
- name: Set up SSH agent for private repository clone
96-
if: matrix.target != 'i686-pc-windows-msvc'
97-
uses: webfactory/[email protected]
98-
with:
99-
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
100-
101-
- name: Add Git server to known hosts
102-
if: matrix.platform != 'windows-latest'
103-
run: |
104-
mkdir -p ~/.ssh
105-
ssh-keyscan github.com >> ~/.ssh/known_hosts
106-
chmod 600 ~/.ssh/known_hosts
107-
108108
- name: Pizza engine features setup
109109
working-directory: src-tauri
110-
if: matrix.target != 'i686-pc-windows-msvc'
111110
run: |
112-
rustup target add ${{ matrix.target }}
113-
(cd .. && make add-dep-pizza-engine)
111+
112+
114113
115114
- name: Build the app with ${{ matrix.platform }}
116115
uses: tauri-apps/tauri-action@v0

0 commit comments

Comments
 (0)