From b3f96a53435e95543a7306daf1e7f66e779130b6 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Thu, 10 Nov 2022 23:37:03 +0100 Subject: [PATCH] chore: switch to dist.ipfs.tech (#55) See https://github.com/protocol/bifrost-infra/issues/2018 --- .../actions/check-for-go-ipfs-release/entrypoint.sh | 6 +++--- .github/actions/publish/entrypoint.sh | 4 ++-- README.md | 13 +++++-------- src/download.js | 2 +- test/download.js | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/actions/check-for-go-ipfs-release/entrypoint.sh b/.github/actions/check-for-go-ipfs-release/entrypoint.sh index d2a661c..68edc82 100755 --- a/.github/actions/check-for-go-ipfs-release/entrypoint.sh +++ b/.github/actions/check-for-go-ipfs-release/entrypoint.sh @@ -1,12 +1,12 @@ #!/usr/bin/env bash set -eu -echo '💫 Checking https://dist.ipfs.io/go-ipfs/versions for new releases...' +echo '💫 Checking https://dist.ipfs.tech/go-ipfs/versions for new releases...' # The version in packge.json e.g. "0.4.20" CURRENT=`node -e 'console.log(require("./package.json").version)'` -# The latest version on dist.ipfs.io e.g. "0.4.21" -LATEST=`curl --silent https://dist.ipfs.io/go-ipfs/versions | tail -n 1 | cut -c 2-` +# The latest version on dist.ipfs.tech e.g. "0.4.21" +LATEST=`curl --silent https://dist.ipfs.tech/go-ipfs/versions | tail -n 1 | cut -c 2-` # Verify $LATEST is valid semver! if ! npx semver $LATEST; then diff --git a/.github/actions/publish/entrypoint.sh b/.github/actions/publish/entrypoint.sh index 93dda57..e9be16c 100755 --- a/.github/actions/publish/entrypoint.sh +++ b/.github/actions/publish/entrypoint.sh @@ -22,8 +22,8 @@ fi # The version in packge.json e.g. "0.4.20" CURRENT=`node -e 'console.log(require("./package.json").version)'` -# The latest version on dist.ipfs.io e.g. "0.4.21" -LATEST=`curl --silent https://dist.ipfs.io/go-ipfs/versions | tail -n 1 | cut -c 2-` +# The latest version on dist.ipfs.tech e.g. "0.4.21" +LATEST=`curl --silent https://dist.ipfs.tech/go-ipfs/versions | tail -n 1 | cut -c 2-` # Verify $LATEST is valid semver! if ! npx semver $LATEST; then diff --git a/README.md b/README.md index 5d2fe9c..bdcb7ea 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,9 @@ # npm-go-ipfs -[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) -[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) -[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) +[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech/) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme) -[![Dependency Status](https://david-dm.org/ipfs/npm-go-ipfs.svg?style=flat-square)](https://david-dm.org/ipfs/npm-go-ipfs) -> install go-ipfs from npm +> install [Kubo](https://github.com/ipfs/kubo) (previously known as "go-ipfs") from npm ## Table of Contents @@ -19,7 +16,7 @@ ## Install -Install the latest [go-ipfs](https://github.com/ipfs/go-ipfs/) binary: +Install the latest [Kubo](https://github.com/ipfs/kubo/) (go-ipfs) binary: ```sh # Install globally @@ -35,7 +32,7 @@ ipfs version v0.7.0 ## Usage -This module downloads `go-ipfs` binaries from https://dist.ipfs.io into your project. +This module downloads Kubo (go-ipfs) binaries from https://dist.ipfs.tech into your project. It will download the go-ipfs version that matches the npm version of this module. So depending on `go-ipfs@0.7.0` will install `go-ipfs v0.7.0` for your current system architecture, in to your project at `node_modules/go-ipfs/go-ipfs/ipfs` and additional symlink to it at `node_modules/go-ipfs/bin/ipfs`. @@ -71,7 +68,7 @@ publish a version of go-ipfs to npm This will: -- check the version is indeed a tag in https://github.com/ipfs/go-ipfs +- check the version is indeed a tag in https://github.com/ipfs/kubo - check the size of `bin/ipfs` is right (must be the checked in file) - update the version numbers in `package.json` and `README.md` - `git commit` the changes diff --git a/src/download.js b/src/download.js index eec24ca..f975add 100644 --- a/src/download.js +++ b/src/download.js @@ -116,7 +116,7 @@ function cleanArguments (version, platform, arch, installPath) { cwd: process.env.INIT_CWD || process.cwd(), defaults: { version: 'v' + pkg.version.replace(/-[0-9]+/, ''), - distUrl: 'https://dist.ipfs.io' + distUrl: 'https://dist.ipfs.tech' } }) diff --git a/test/download.js b/test/download.js index 6ac6638..0f3b3d2 100644 --- a/test/download.js +++ b/test/download.js @@ -29,7 +29,7 @@ test('Returns an error when version unsupported', async (t) => { test('Returns an error when dist url is 404', async (t) => { await clean() - process.env.GO_IPFS_DIST_URL = 'https://dist.ipfs.io/notfound' + process.env.GO_IPFS_DIST_URL = 'https://dist.ipfs.tech/notfound' await t.rejects(download(), /404/)