Skip to content

Commit 0c29de9

Browse files
authored
chore: Replace macos-13 github runner with macos-15 (#186)
macOS 13 runners have been deprecated: actions/runner-images#13046 The build was failing with an unhelpful error "fetch failed". I improved error logging ([example](https://github.com/coralogix/protofetch/actions/runs/20776625858/job/59665172896)), and replaced `python3 -m http.server` with a specialized github action which seems to be more reliable.
1 parent f81e84e commit 0c29de9

File tree

3 files changed

+16
-27
lines changed

3 files changed

+16
-27
lines changed

.github/npm/src/getBinary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async function downloadBinary(options = {}) {
9191
}
9292
}
9393

94-
throw new Error(`Failed to download protofetch after 3 attempts: ${lastError.message}`);
94+
throw new Error(`Failed to download protofetch after 3 attempts`, { cause: lastError });
9595
}
9696

9797
export { downloadBinary };

.github/npm/src/scripts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ if (process.argv.includes('install')) {
3737
process.exit(0);
3838
})
3939
.catch((error) => {
40-
console.error('Installation failed:', error.message);
40+
console.error('Installation failed:', error);
4141
process.exit(1);
4242
});
4343
}

.github/workflows/ci.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: cargo test
4949

5050
versions:
51-
runs-on: ubuntu-latest
51+
runs-on: ubuntu-latest
5252
steps:
5353
- uses: taiki-e/install-action@v2
5454
with:
@@ -65,16 +65,16 @@ jobs:
6565
run: cargo minimal-versions check --rust-version --features vendored-openssl,vendored-libgit2
6666

6767
semver:
68-
runs-on: ubuntu-latest
68+
runs-on: ubuntu-latest
6969
steps:
7070
- name: Checkout sources
7171
uses: actions/checkout@v3
7272

7373
- name: Check semver
7474
uses: obi1kenobi/cargo-semver-checks-action@v2
75-
75+
7676
flake:
77-
runs-on: ubuntu-latest
77+
runs-on: ubuntu-latest
7878
steps:
7979
- name: Checkout sources
8080
uses: actions/checkout@v3
@@ -106,24 +106,24 @@ jobs:
106106
runner: ubuntu-latest
107107
tar: tar
108108
cross: true
109-
ext:
109+
ext: ''
110110
- rust: x86_64-unknown-linux-musl
111111
runner: ubuntu-latest
112112
tar: tar
113113
cross: true
114-
ext:
114+
ext: ''
115115
- rust: aarch64-apple-darwin
116116
runner: macos-14
117117
# We use gtar to make sure compressed files are not detected as sparse
118118
tar: gtar
119119
cross: false
120-
ext:
120+
ext: ''
121121
- rust: x86_64-apple-darwin
122-
runner: macos-13
122+
runner: macos-15-intel
123123
# We use gtar to make sure compressed files are not detected as sparse
124124
tar: gtar
125125
cross: false
126-
ext:
126+
ext: ''
127127
- rust: x86_64-pc-windows-msvc
128128
runner: windows-latest
129129
tar: tar
@@ -167,7 +167,7 @@ jobs:
167167
platform: x86_64-unknown-linux-musl
168168
- runner: macos-14
169169
platform: aarch64-apple-darwin
170-
- runner: macos-13
170+
- runner: macos-15-intel
171171
platform: x86_64-apple-darwin
172172
- runner: windows-latest
173173
platform: x86_64-pc-windows-msvc
@@ -199,13 +199,10 @@ jobs:
199199
node .github/npm/prepare-package.js --package coralogix-protofetch --version 0.0.0-test
200200
201201
- name: Start HTTP server
202-
shell: bash
203-
run: |
204-
cd artifacts
205-
python3 -m http.server 8000 &
206-
echo $! > /tmp/http_server.pid
207-
sleep 2
208-
echo "HTTP server started on port 8000"
202+
uses: Eun/http-server-action@v1
203+
with:
204+
port: 8000
205+
directory: artifacts
209206

210207
- name: Test npm installation
211208
shell: bash
@@ -246,14 +243,6 @@ jobs:
246243
./bin/protofetch --version
247244
fi
248245
249-
- name: Stop HTTP server
250-
if: always()
251-
shell: bash
252-
run: |
253-
if [ -f /tmp/http_server.pid ]; then
254-
kill $(cat /tmp/http_server.pid) || true
255-
fi
256-
257246
release:
258247
if: github.repository == 'coralogix/protofetch' && startsWith(github.ref, 'refs/tags/')
259248
needs: [ package, test-npm-package ]

0 commit comments

Comments
 (0)