Skip to content

Commit

Permalink
Merge pull request #937 from TRON-US/v1.5.1-release
Browse files Browse the repository at this point in the history
V1.5.1 release
  • Loading branch information
Eric Chen authored Mar 5, 2021
2 parents c234341 + 3633161 commit 208e586
Show file tree
Hide file tree
Showing 54 changed files with 2,134 additions and 545 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/github-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: github-release

on:
release:
types:
- created

jobs:
build-push:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Extract Repo Name Lowercase
shell: bash
run: echo "##[set-output name=repo;]$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
id: extract_repo

# extract tag name
-
name: Extract git tag
run: |
echo IMAGE_TAG=$(echo ${GITHUB_REF#refs/tags/}) >> $GITHUB_ENV
-
name: Get Image tag
shell: bash
run: echo "##[set-output name=tag;]$(echo ${IMAGE_TAG})"
id: extract_image_tag
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_PAT }}
-
name: Build and push for release
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
ghcr.io/${{ steps.extract_repo.outputs.repo }}:${{ steps.extract_image_tag.outputs.tag }}
36 changes: 36 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: pr

on:
pull_request:
branches:
- 'master'
- 'release'

jobs:
build-only:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Extract Repo Name Lowercase
shell: bash
run: echo "##[set-output name=repo;]$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
id: extract_repo

-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Only Build on PRs
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: false

69 changes: 69 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: git-push

on:
push:
branches:
- 'master'
- 'release'

jobs:
build-push:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Extract Repo Name Lowercase
shell: bash
run: echo "##[set-output name=repo;]$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')"
id: extract_repo

# extract branch name
-
name: Extract branch name
run: |
echo IMAGE_TAG=$(echo ${GITHUB_REF#refs/heads/}) >> $GITHUB_ENV
-
name: Get Image tag
shell: bash
run: echo "##[set-output name=tag;]$(echo ${IMAGE_TAG})"
id: extract_image_tag
-
name: Set up QEMU
uses: docker/setup-qemu-action@v1
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
-
name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_PAT }}
-
name: Build and push if master branch
if: ${{ steps.extract_image_tag.outputs.tag }} == 'master'
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
ghcr.io/${{ steps.extract_repo.outputs.repo }}:edge
ghcr.io/${{ steps.extract_repo.outputs.repo }}:${{ steps.extract_image_tag.outputs.tag }}
-
name: Build and push if release branch
if: ${{ steps.extract_image_tag.outputs.tag }} == 'release'
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm/v7,linux/arm64
push: true
tags: |
ghcr.io/${{ steps.extract_repo.outputs.repo }}:latest
ghcr.io/${{ steps.extract_repo.outputs.repo }}:${{ steps.extract_image_tag.outputs.tag }}
3 changes: 2 additions & 1 deletion assets/assets.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//go:generate git submodule update --init ./dir-index-html
//go:generate go run github.com/go-bindata/go-bindata/v3/go-bindata -mode=0644 -modtime=1403768328 -pkg=assets init-doc dir-index-html/dir-index.html dir-index-html/knownIcons.txt
//go:generate gofmt -w bindata.go
//go:generate sh -c "sed -i \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go"
//go:generate bash -c "if [ $(uname) == \"Darwin\" ] ; then sed -i '' \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go ; fi"
//go:generate bash -c "if [ $(uname) != \"Darwin\" ] ; then sed -i \"s/.*BindataVersionHash.*/BindataVersionHash=\\\"$(git hash-object bindata.go)\\\"/\" bindata_version_hash.go ; fi"
//go:generate gofmt -w bindata_version_hash.go
package assets

Expand Down
21 changes: 11 additions & 10 deletions assets/bindata.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/bindata_version_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package assets

const (
BindataVersionHash = "ff1a4627d4010c38fb0e1bb38b7a28cd75599009"
BindataVersionHash = "3d1722b2e4395785e309a3e7da3a7e79fd8fb923"
)
1 change: 1 addition & 0 deletions assets/dir-index-html
Submodule dir-index-html added at 666228
7 changes: 6 additions & 1 deletion cmd/btfs/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
oldcmds "github.com/TRON-US/go-btfs/commands"
"github.com/TRON-US/go-btfs/core"
commands "github.com/TRON-US/go-btfs/core/commands"
"github.com/TRON-US/go-btfs/core/commands/cmdenv"
"github.com/TRON-US/go-btfs/core/commands/storage/path"
"github.com/TRON-US/go-btfs/core/commands/storage/upload/helper"
corehttp "github.com/TRON-US/go-btfs/core/corehttp"
Expand Down Expand Up @@ -551,7 +552,11 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
}
// Spin jobs in the background
spin.RenterSessions(req, env)
spin.Analytics(cctx.ConfigRoot, node, version.CurrentVersionNumber, hValue)
api, err := cmdenv.GetApi(env, req)
if err != nil {
return err
}
spin.Analytics(api, cctx.ConfigRoot, node, version.CurrentVersionNumber, hValue)
spin.Hosts(node, env)
spin.Contracts(node, req, env, nodepb.ContractStat_HOST.String())
if params, err := helper.ExtractContextParams(req, env); err == nil {
Expand Down
8 changes: 7 additions & 1 deletion cmd/btfs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,13 @@ func makeExecutor(req *cmds.Request, env interface{}) (cmds.Executor, error) {
daemonRequested := apiAddr != nil && req.Command != daemonCmd

// Run this on the client if required.
if req.Command.NoRemote {
var accessible bool
if req.Command == daemonCmd {
accessible = !req.Command.NoRemote
} else {
accessible = cmdhttp.RemoteAccessible(req.Command, "127.0.0.1")
}
if !accessible {
if daemonRequested {
// User requested that the command be run on the daemon but we can't.
// NOTE: We drop this check for the `ipfs daemon` command.
Expand Down
Loading

0 comments on commit 208e586

Please sign in to comment.