Skip to content

Commit

Permalink
Merge pull request #8597 from ipfs/release-v0.11.0
Browse files Browse the repository at this point in the history
Release v0.11.0
  • Loading branch information
aschmahmann authored Dec 8, 2021
2 parents 64b532f + 4ec7aec commit 67220ed
Show file tree
Hide file tree
Showing 154 changed files with 5,643 additions and 964 deletions.
40 changes: 34 additions & 6 deletions .circleci/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ executors:
environment:
<<: *default_environment
NO_SANDBOX: true
IPFS_REUSEPORT: false
LIBP2P_TCP_REUSEPORT: false
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
E2E_IPFSD_TYPE: go
dockerizer:
Expand Down Expand Up @@ -105,7 +105,22 @@ jobs:
when: always
command: bash <(curl -s https://codecov.io/bash) -cF unittests -X search -f coverage/unit_tests.coverprofile
- run:
command: go test -v ./...
command: |
# we want to test the examples against the current version of go-ipfs
# however, that version might be in a fork so we need to replace the dependency
# backup the go.mod and go.sum files to restore them after we run the tests
cp go.mod go.mod.bak
cp go.sum go.sum.bak
# make sure the examples run against the current version of go-ipfs
go mod edit -replace github.com/ipfs/go-ipfs=./../../..
go mod tidy
go test -v ./...
# restore the go.mod and go.sum files to their original state
mv go.mod.bak go.mod
mv go.sum.bak go.sum
working_directory: ~/ipfs/go-ipfs/docs/examples/go-ipfs-as-a-library

- run:
Expand Down Expand Up @@ -201,7 +216,8 @@ jobs:
- bin/ipfs
- *store_gomod
interop:
executor: node
docker:
- image: cimg/go:1.16-node
parallelism: 4
steps:
- *make_out_dirs
Expand All @@ -211,21 +227,33 @@ jobs:
name: Installing dependencies
command: |
npm init -y
npm install ipfs@^0.52.2
npm install ipfs-interop@^4.0.0
npm install ipfs@^0.59.1
npm install ipfs/interop#master
npm install [email protected]
working_directory: ~/ipfs/go-ipfs/interop
- run:
name: Running tests
command: |
WORKDIR=$(pwd)
cd /tmp
git clone https://github.com/ipfs/js-ipfs.git
cd js-ipfs
git checkout 1dcac76f56972fc3519526e93567e39d685033dd
npm install
npm run build
npm run link
cd $WORKDIR
mkdir -p /tmp/test-results/interop/
export MOCHA_FILE="$(mktemp /tmp/test-results/interop/unit.XXXXXX.xml)"
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
working_directory: ~/ipfs/go-ipfs/interop
environment:
IPFS_REUSEPORT: false
LIBP2P_TCP_REUSEPORT: false
LIBP2P_ALLOW_WEAK_RSA_KEYS: 1
IPFS_GO_EXEC: /tmp/circleci-workspace/bin/ipfs
IPFS_JS_EXEC: /tmp/js-ipfs/packages/ipfs/src/cli.js
IPFS_JS_MODULE: /tmp/js-ipfs/packages/ipfs/dist/cjs/src/index.js
IPFS_JS_HTTP_MODULE: /tmp/js-ipfs/packages/ipfs-http-client/dist/cjs/src/index.js
- store_test_results:
path: /tmp/test-results
go-ipfs-api:
Expand Down
124 changes: 124 additions & 0 deletions .github/workflows/sync-release-assets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: Sync github release assets with dist.ipfs.io

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'

concurrency:
group: release-assets-dist-sync
cancel-in-progress: true

jobs:
sync-github-and-dist-ipfs-io:
runs-on: "ubuntu-latest"
steps:
- name: Setup go
uses: actions/setup-go@v2
with:
go-version: '1.16'
- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build go-ipfs binary
run: go install github.com/ipfs/go-ipfs/cmd/ipfs@latest
- name: Initialize go-ipfs and start daemon
run: |
sudo sysctl -w net.core.rmem_max=2500000
ipfs init --profile flatfs,server
ipfs daemon --enable-gc=false &
while (! ipfs id --api "/ip4/127.0.0.1/tcp/5001"); do sleep 1; done
- name: Wait for go-ipfs to be ready
shell: pwsh
run: |
for ($i = 0; $i -lt 10; $i++) {
$addrs = ipfs id | jq .Addresses;
if ($addrs -eq "null") {
sleep 1
} else {
echo "Successfully started the daemon"
exit 0
}
}
- uses: actions/setup-node@v2
with:
node-version: 14
- name: Sync the latest 5 github releases
uses: actions/github-script@v4
with:
script: |
const fs = require('fs').promises
const max_synced = 5
// fetch github releases
resp = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
page: 1,
per_page: max_synced
})
const release_assets = [];
num_synced = 0;
for (const release of resp.data) {
console.log("checking release tagged", release.tag_name)
if (num_synced > max_synced) {
console.log("done: synced", max_synced, "latest releases")
break;
}
num_synced += 1
const github_assets = [];
github_map = {};
for (const asset of release.assets) {
github_assets.push(asset.name);
github_map[asset.name] = true;
}
// fetch asset info from dist.ipfs.io
p = '/ipns/dist.ipfs.io/go-ipfs/' + release.tag_name
let stdout = ''
const options = {}
options.listeners = {
stdout: (data) => {
stdout += data.toString();
}
}
await exec.exec('ipfs', ['ls', p], options)
const dist_assets = []
missing_files = []
for (const raw_line of stdout.split("\n")) {
line = raw_line.trim();
if (line.length != 0) {
file = line.split(/(\s+)/).filter( function(e) { return e.trim().length > 0; } )[2]
dist_assets.push(file)
if (!github_map[file]) {
missing_files.push(file)
}
}
}
// if dist.ipfs.io has files not found in github, copy them over
for (const file of missing_files) {
console.log("fetching", file, "from dist.ipfs.io")
await exec.exec('ipfs', ['get', p + '/' + file])
const data = await fs.readFile(file, "binary")
console.log("uploading", file, "to github release", release.tag_name)
resp = await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.id,
name: file,
data: data,
})
}
// summary of assets on both sides
release_assets.push({ tag: release.tag_name, github_assets: github_assets, dist_assets: dist_assets })
}
console.log(release_assets)
return release_assets
33 changes: 33 additions & 0 deletions .github/workflows/testground-on-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Testground PR Checker

on: [push]

jobs:
testground:
runs-on: ubuntu-latest
name: ${{ matrix.composition_file }}
strategy:
matrix:
include:
- backend_addr: ci.testground.ipfs.team
backend_proto: https
plan_directory: testplans/bitswap
composition_file: testplans/bitswap/_compositions/small-k8s.toml
- backend_addr: ci.testground.ipfs.team
backend_proto: https
plan_directory: testplans/bitswap
composition_file: testplans/bitswap/_compositions/medium-k8s.toml
- backend_addr: ci.testground.ipfs.team
backend_proto: https
plan_directory: testplans/bitswap
composition_file: testplans/bitswap/_compositions/large-k8s.toml
steps:
- uses: actions/checkout@v2
- name: testground run
uses: coryschwartz/[email protected]
with:
backend_addr: ${{ matrix.backend_addr }}
backend_proto: ${{ matrix.backend_proto }}
plan_directory: ${{ matrix.plan_directory }}
composition_file: ${{ matrix.composition_file }}
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Loading

0 comments on commit 67220ed

Please sign in to comment.