Skip to content

Commit 575bcc0

Browse files
committed
Oops...needed to fix a dependency...
1 parent 8d433d5 commit 575bcc0

File tree

5 files changed

+102
-29
lines changed

5 files changed

+102
-29
lines changed

.github/workflows/CI.yml

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ env:
44
DEBUG: napi:*
55
APP_NAME: python-node
66
MACOSX_DEPLOYMENT_TARGET: '10.13'
7+
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
78

89
permissions:
910
contents: write
@@ -23,6 +24,10 @@ on:
2324
- docs/**
2425
pull_request:
2526

27+
concurrency:
28+
group: ${{ github.workflow }}-${{ github.ref }}-ci
29+
cancel-in-progress: true
30+
2631
jobs:
2732
build:
2833
strategy:
@@ -86,7 +91,7 @@ jobs:
8691
if: ${{ matrix.settings.docker }}
8792
with:
8893
image: ${{ matrix.settings.docker }}
89-
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build'
94+
options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -v ${{ github.workspace }}/.ssh:.ssh -w /build'
9095
run: |
9196
set -x
9297
@@ -98,15 +103,38 @@ jobs:
98103
corepack disable
99104
npm i -gf pnpm
100105
101-
# Set up SSH key (to checkout private repos with cargo)
106+
# Set up SSH keys (to checkout private repos with cargo)
102107
mkdir -p ~/.ssh
103-
chmod -R 400 ~/.ssh
104-
touch ~/.ssh/config ~/.ssh/known_hosts
105-
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 -
108-
ssh-add -l
108+
chmod 700 ~/.ssh
109+
110+
# Save SSH keys to files
111+
echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_handler_key
112+
echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_rewriter_key
113+
chmod 600 ~/.ssh/http_handler_key
114+
chmod 600 ~/.ssh/http_rewriter_key
115+
116+
# Add GitHub to known hosts
109117
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
118+
119+
# Create SSH config
120+
cat > ~/.ssh/config <<'EOF'
121+
Host github-http-handler
122+
HostName github.com
123+
User git
124+
IdentityFile ~/.ssh/http_handler_key
125+
IdentitiesOnly yes
126+
127+
Host github-http-rewriter
128+
HostName github.com
129+
User git
130+
IdentityFile ~/.ssh/http_rewriter_key
131+
IdentitiesOnly yes
132+
EOF
133+
chmod 600 ~/.ssh/config
134+
135+
# Configure git to use the correct SSH hosts
136+
git config --global url."git@github-http-handler:platformatic/http-handler.git".insteadOf "git@github.com:platformatic/http-handler.git"
137+
git config --global url."git@github-http-rewriter:platformatic/http-rewriter.git".insteadOf "git@github.com:platformatic/http-rewriter.git"
110138
111139
${{ matrix.settings.build }}
112140
- name: Build
@@ -240,15 +268,38 @@ jobs:
240268
curl https://sh.rustup.rs -sSf | bash -s -- -y -t ${{ matrix.settings.target }}
241269
source "$HOME/.cargo/env"
242270
243-
# Set up SSH key (to checkout private repos with cargo)
271+
# Set up SSH keys (to checkout private repos with cargo)
244272
mkdir -p ~/.ssh
245-
chmod -R 400 ~/.ssh
246-
touch ~/.ssh/config ~/.ssh/known_hosts
247-
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 -
250-
ssh-add -l
273+
chmod 700 ~/.ssh
274+
275+
# Save SSH keys to files
276+
echo "${{ secrets.HTTP_HANDLER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_handler_key
277+
echo "${{ secrets.HTTP_REWRITER_ACCESS_TOKEN }}" | tr -d '\r' > ~/.ssh/http_rewriter_key
278+
chmod 600 ~/.ssh/http_handler_key
279+
chmod 600 ~/.ssh/http_rewriter_key
280+
281+
# Add GitHub to known hosts
251282
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
283+
284+
# Create SSH config
285+
cat > ~/.ssh/config <<'EOF'
286+
Host github-http-handler
287+
HostName github.com
288+
User git
289+
IdentityFile ~/.ssh/http_handler_key
290+
IdentitiesOnly yes
291+
292+
Host github-http-rewriter
293+
HostName github.com
294+
User git
295+
IdentityFile ~/.ssh/http_rewriter_key
296+
IdentitiesOnly yes
297+
EOF
298+
chmod 600 ~/.ssh/config
299+
300+
# Configure git to use the correct SSH hosts
301+
git config --global url."git@github-http-handler:platformatic/http-handler.git".insteadOf "git@github.com:platformatic/http-handler.git"
302+
git config --global url."git@github-http-rewriter:platformatic/http-rewriter.git".insteadOf "git@github.com:platformatic/http-rewriter.git"
252303
253304
cargo test --target ${{ matrix.settings.target }}
254305
- name: Test bindings

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Lint
22

3+
env:
4+
CARGO_NET_GIT_FETCH_WITH_CLI: 'true'
5+
36
'on':
47
push:
58
branches:

Cargo.lock

Lines changed: 25 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ crate-type = ["cdylib"]
2020
[dependencies]
2121
async-trait = "0.1.88"
2222
bytes = "1.10.1"
23-
http-handler = { git = "ssh://git@github.com/platformatic/http-handler" }
23+
http-handler = { git = "ssh://git@github.com/platformatic/http-handler.git" }
2424
# http-handler = { path = "../http-handler" }
25-
# http-rewriter = { git = "ssh://git@github.com/platformatic/http-rewriter" }
26-
http-rewriter = { path = "../http-rewriter" }
25+
http-rewriter = { git = "ssh://git@github.com/platformatic/http-rewriter.git" }
26+
# http-rewriter = { path = "../http-rewriter" }
2727
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
2828
napi = { version = "3.0.0-beta.8", default-features = false, features = ["napi4"], optional = true }
2929
napi-derive = { version = "3.0.0-beta.8", optional = true }

rust-toolchain.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[toolchain]
2+
channel = "stable"
3+
components = [ "rustfmt", "rustc-dev", "clippy" ]
4+
targets = [ "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu" ]
5+
profile = "minimal"

0 commit comments

Comments
 (0)