44 DEBUG : napi:*
55 APP_NAME : python-node
66 MACOSX_DEPLOYMENT_TARGET : ' 10.13'
7+ CARGO_NET_GIT_FETCH_WITH_CLI : ' true'
78
89permissions :
910 contents : write
2324 - docs/**
2425 pull_request :
2526
27+ concurrency :
28+ group : ${{ github.workflow }}-${{ github.ref }}-ci
29+ cancel-in-progress : true
30+
2631jobs :
2732 build :
2833 strategy :
9095 run : |
9196 set -x
9297
98+ export CARGO_NET_GIT_FETCH_WITH_CLI=true
99+
93100 # Install apt dependencies
94101 apt-get update -y
95102 apt-get install -y openssh-client
@@ -98,16 +105,49 @@ jobs:
98105 corepack disable
99106 npm i -gf pnpm
100107
101- # Set up SSH key (to checkout private repos with cargo)
108+ # Set up SSH keys (to checkout private repos with cargo)
102109 mkdir -p ~/.ssh
103- chmod -R 400 ~/.ssh
104- touch ~/.ssh/config ~/.ssh/known_hosts
110+ chmod 700 ~/.ssh
111+
112+ # Save SSH keys to files
113+ echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_handler_key
114+ echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_rewriter_key
115+ chmod 600 ~/.ssh/http_handler_key
116+ chmod 600 ~/.ssh/http_rewriter_key
117+
118+ # Start ssh-agent and add keys
105119 eval `ssh-agent -s`
106- echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
107- echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
120+ ssh-add ~/.ssh/http_handler_key
121+ ssh-add ~/.ssh/http_rewriter_key
108122 ssh-add -l
123+
124+ # Add GitHub to known hosts
109125 ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
110126
127+ # Create SSH config with host aliases
128+ cat > ~/.ssh/config <<'EOF'
129+ Host github.com-http-handler
130+ HostName github.com
131+ User git
132+ IdentityFile ~/.ssh/http_handler_key
133+ IdentitiesOnly yes
134+
135+ Host github.com-http-rewriter
136+ HostName github.com
137+ User git
138+ IdentityFile ~/.ssh/http_rewriter_key
139+ IdentitiesOnly yes
140+ EOF
141+ chmod 600 ~/.ssh/config
142+
143+ # Configure git to use the correct SSH hosts
144+ git config --global url."git@github.com-http-handler:platformatic/http-handler.git".insteadOf "git@github.com:platformatic/http-handler.git"
145+ git config --global url."git@github.com-http-rewriter:platformatic/http-rewriter.git".insteadOf "git@github.com:platformatic/http-rewriter.git"
146+
147+ # Also configure HTTPS to SSH rewriting in case cargo uses HTTPS URLs
148+ git config --global url."git@github.com-http-handler:platformatic/http-handler.git".insteadOf "https://github.com/platformatic/http-handler.git"
149+ git config --global url."git@github.com-http-rewriter:platformatic/http-rewriter.git".insteadOf "https://github.com/platformatic/http-rewriter.git"
150+
111151 ${{ matrix.settings.build }}
112152 - name : Build
113153 run : ${{ matrix.settings.build }}
@@ -232,6 +272,8 @@ jobs:
232272 run : |
233273 set -x
234274
275+ export CARGO_NET_GIT_FETCH_WITH_CLI=true
276+
235277 # Install apt dependencies
236278 apt-get update -y
237279 apt-get install -y openssh-client curl
@@ -240,16 +282,49 @@ jobs:
240282 curl https://sh.rustup.rs -sSf | bash -s -- -y -t ${{ matrix.settings.target }}
241283 source "$HOME/.cargo/env"
242284
243- # Set up SSH key (to checkout private repos with cargo)
285+ # Set up SSH keys (to checkout private repos with cargo)
244286 mkdir -p ~/.ssh
245- chmod -R 400 ~/.ssh
246- touch ~/.ssh/config ~/.ssh/known_hosts
287+ chmod 700 ~/.ssh
288+
289+ # Save SSH keys to files
290+ echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_handler_key
291+ echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_rewriter_key
292+ chmod 600 ~/.ssh/http_handler_key
293+ chmod 600 ~/.ssh/http_rewriter_key
294+
295+ # Start ssh-agent and add keys
247296 eval `ssh-agent -s`
248- echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
249- echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' | ssh-add -
297+ ssh-add ~/.ssh/http_handler_key
298+ ssh-add ~/.ssh/http_rewriter_key
250299 ssh-add -l
300+
301+ # Add GitHub to known hosts
251302 ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
252303
304+ # Create SSH config with host aliases
305+ cat > ~/.ssh/config <<'EOF'
306+ Host github.com-http-handler
307+ HostName github.com
308+ User git
309+ IdentityFile ~/.ssh/http_handler_key
310+ IdentitiesOnly yes
311+
312+ Host github.com-http-rewriter
313+ HostName github.com
314+ User git
315+ IdentityFile ~/.ssh/http_rewriter_key
316+ IdentitiesOnly yes
317+ EOF
318+ chmod 600 ~/.ssh/config
319+
320+ # Configure git to use the correct SSH hosts
321+ git config --global url."git@github.com-http-handler:platformatic/http-handler.git".insteadOf "git@github.com:platformatic/http-handler.git"
322+ git config --global url."git@github.com-http-rewriter:platformatic/http-rewriter.git".insteadOf "git@github.com:platformatic/http-rewriter.git"
323+
324+ # Also configure HTTPS to SSH rewriting in case cargo uses HTTPS URLs
325+ git config --global url."git@github.com-http-handler:platformatic/http-handler.git".insteadOf "https://github.com/platformatic/http-handler.git"
326+ git config --global url."git@github.com-http-rewriter:platformatic/http-rewriter.git".insteadOf "https://github.com/platformatic/http-rewriter.git"
327+
253328 cargo test --target ${{ matrix.settings.target }}
254329 - name : Test bindings
255330 uses : addnab/docker-run-action@v3
0 commit comments