Skip to content

Commit 67220ed

Browse files
authored
Merge pull request #8597 from ipfs/release-v0.11.0
Release v0.11.0
2 parents 64b532f + 4ec7aec commit 67220ed

File tree

154 files changed

+5643
-964
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+5643
-964
lines changed

.circleci/main.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ executors:
5656
environment:
5757
<<: *default_environment
5858
NO_SANDBOX: true
59-
IPFS_REUSEPORT: false
59+
LIBP2P_TCP_REUSEPORT: false
6060
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
6161
E2E_IPFSD_TYPE: go
6262
dockerizer:
@@ -105,7 +105,22 @@ jobs:
105105
when: always
106106
command: bash <(curl -s https://codecov.io/bash) -cF unittests -X search -f coverage/unit_tests.coverprofile
107107
- run:
108-
command: go test -v ./...
108+
command: |
109+
# we want to test the examples against the current version of go-ipfs
110+
# however, that version might be in a fork so we need to replace the dependency
111+
112+
# backup the go.mod and go.sum files to restore them after we run the tests
113+
cp go.mod go.mod.bak
114+
cp go.sum go.sum.bak
115+
116+
# make sure the examples run against the current version of go-ipfs
117+
go mod edit -replace github.com/ipfs/go-ipfs=./../../..
118+
go mod tidy
119+
go test -v ./...
120+
121+
# restore the go.mod and go.sum files to their original state
122+
mv go.mod.bak go.mod
123+
mv go.sum.bak go.sum
109124
working_directory: ~/ipfs/go-ipfs/docs/examples/go-ipfs-as-a-library
110125

111126
- run:
@@ -201,7 +216,8 @@ jobs:
201216
- bin/ipfs
202217
- *store_gomod
203218
interop:
204-
executor: node
219+
docker:
220+
- image: cimg/go:1.16-node
205221
parallelism: 4
206222
steps:
207223
- *make_out_dirs
@@ -211,21 +227,33 @@ jobs:
211227
name: Installing dependencies
212228
command: |
213229
npm init -y
214-
npm install ipfs@^0.52.2
215-
npm install ipfs-interop@^4.0.0
230+
npm install ipfs@^0.59.1
231+
npm install ipfs/interop#master
216232
npm install [email protected]
217233
working_directory: ~/ipfs/go-ipfs/interop
218234
- run:
219235
name: Running tests
220236
command: |
237+
WORKDIR=$(pwd)
238+
cd /tmp
239+
git clone https://github.com/ipfs/js-ipfs.git
240+
cd js-ipfs
241+
git checkout 1dcac76f56972fc3519526e93567e39d685033dd
242+
npm install
243+
npm run build
244+
npm run link
245+
cd $WORKDIR
221246
mkdir -p /tmp/test-results/interop/
222247
export MOCHA_FILE="$(mktemp /tmp/test-results/interop/unit.XXXXXX.xml)"
223248
npx ipfs-interop -- -t node -f $(sed -n -e "s|^require('\(.*\)')$|test/\1|p" node_modules/ipfs-interop/test/node.js | circleci tests split) -- --reporter mocha-circleci-reporter
224249
working_directory: ~/ipfs/go-ipfs/interop
225250
environment:
226-
IPFS_REUSEPORT: false
251+
LIBP2P_TCP_REUSEPORT: false
227252
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
228253
IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
254+
IPFS_JS_EXEC: /tmp/js-ipfs/packages/ipfs/src/cli.js
255+
IPFS_JS_MODULE: /tmp/js-ipfs/packages/ipfs/dist/cjs/src/index.js
256+
IPFS_JS_HTTP_MODULE: /tmp/js-ipfs/packages/ipfs-http-client/dist/cjs/src/index.js
229257
- store_test_results:
230258
path: /tmp/test-results
231259
go-ipfs-api:
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
name: Sync github release assets with dist.ipfs.io
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *'
7+
8+
concurrency:
9+
group: release-assets-dist-sync
10+
cancel-in-progress: true
11+
12+
jobs:
13+
sync-github-and-dist-ipfs-io:
14+
runs-on: "ubuntu-latest"
15+
steps:
16+
- name: Setup go
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: '1.16'
20+
- uses: actions/cache@v2
21+
with:
22+
path: |
23+
~/.cache/go-build
24+
~/go/pkg/mod
25+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
26+
restore-keys: |
27+
${{ runner.os }}-go-
28+
- name: Build go-ipfs binary
29+
run: go install github.com/ipfs/go-ipfs/cmd/ipfs@latest
30+
- name: Initialize go-ipfs and start daemon
31+
run: |
32+
sudo sysctl -w net.core.rmem_max=2500000
33+
ipfs init --profile flatfs,server
34+
ipfs daemon --enable-gc=false &
35+
while (! ipfs id --api "/ip4/127.0.0.1/tcp/5001"); do sleep 1; done
36+
- name: Wait for go-ipfs to be ready
37+
shell: pwsh
38+
run: |
39+
for ($i = 0; $i -lt 10; $i++) {
40+
$addrs = ipfs id | jq .Addresses;
41+
if ($addrs -eq "null") {
42+
sleep 1
43+
} else {
44+
echo "Successfully started the daemon"
45+
exit 0
46+
}
47+
}
48+
- uses: actions/setup-node@v2
49+
with:
50+
node-version: 14
51+
- name: Sync the latest 5 github releases
52+
uses: actions/github-script@v4
53+
with:
54+
script: |
55+
const fs = require('fs').promises
56+
const max_synced = 5
57+
58+
// fetch github releases
59+
resp = await github.repos.listReleases({
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
page: 1,
63+
per_page: max_synced
64+
})
65+
const release_assets = [];
66+
num_synced = 0;
67+
for (const release of resp.data) {
68+
console.log("checking release tagged", release.tag_name)
69+
if (num_synced > max_synced) {
70+
console.log("done: synced", max_synced, "latest releases")
71+
break;
72+
}
73+
num_synced += 1
74+
75+
const github_assets = [];
76+
github_map = {};
77+
for (const asset of release.assets) {
78+
github_assets.push(asset.name);
79+
github_map[asset.name] = true;
80+
}
81+
82+
// fetch asset info from dist.ipfs.io
83+
p = '/ipns/dist.ipfs.io/go-ipfs/' + release.tag_name
84+
let stdout = ''
85+
const options = {}
86+
options.listeners = {
87+
stdout: (data) => {
88+
stdout += data.toString();
89+
}
90+
}
91+
await exec.exec('ipfs', ['ls', p], options)
92+
93+
const dist_assets = []
94+
missing_files = []
95+
for (const raw_line of stdout.split("\n")) {
96+
line = raw_line.trim();
97+
if (line.length != 0) {
98+
file = line.split(/(\s+)/).filter( function(e) { return e.trim().length > 0; } )[2]
99+
dist_assets.push(file)
100+
if (!github_map[file]) {
101+
missing_files.push(file)
102+
}
103+
}
104+
}
105+
106+
// if dist.ipfs.io has files not found in github, copy them over
107+
for (const file of missing_files) {
108+
console.log("fetching", file, "from dist.ipfs.io")
109+
await exec.exec('ipfs', ['get', p + '/' + file])
110+
const data = await fs.readFile(file, "binary")
111+
console.log("uploading", file, "to github release", release.tag_name)
112+
resp = await github.repos.uploadReleaseAsset({
113+
owner: context.repo.owner,
114+
repo: context.repo.repo,
115+
release_id: release.id,
116+
name: file,
117+
data: data,
118+
})
119+
}
120+
// summary of assets on both sides
121+
release_assets.push({ tag: release.tag_name, github_assets: github_assets, dist_assets: dist_assets })
122+
}
123+
console.log(release_assets)
124+
return release_assets
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Testground PR Checker
3+
4+
on: [push]
5+
6+
jobs:
7+
testground:
8+
runs-on: ubuntu-latest
9+
name: ${{ matrix.composition_file }}
10+
strategy:
11+
matrix:
12+
include:
13+
- backend_addr: ci.testground.ipfs.team
14+
backend_proto: https
15+
plan_directory: testplans/bitswap
16+
composition_file: testplans/bitswap/_compositions/small-k8s.toml
17+
- backend_addr: ci.testground.ipfs.team
18+
backend_proto: https
19+
plan_directory: testplans/bitswap
20+
composition_file: testplans/bitswap/_compositions/medium-k8s.toml
21+
- backend_addr: ci.testground.ipfs.team
22+
backend_proto: https
23+
plan_directory: testplans/bitswap
24+
composition_file: testplans/bitswap/_compositions/large-k8s.toml
25+
steps:
26+
- uses: actions/checkout@v2
27+
- name: testground run
28+
uses: coryschwartz/[email protected]
29+
with:
30+
backend_addr: ${{ matrix.backend_addr }}
31+
backend_proto: ${{ matrix.backend_proto }}
32+
plan_directory: ${{ matrix.plan_directory }}
33+
composition_file: ${{ matrix.composition_file }}

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)