From 42d8398ac9e9bf83322df730f2777c63e382b47b Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:28 +0000 Subject: [PATCH 1/9] add version.json file --- version.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 version.json diff --git a/version.json b/version.json new file mode 100644 index 0000000..372b6ea --- /dev/null +++ b/version.json @@ -0,0 +1,3 @@ +{ + "version": "v0.4.0" +} From cbc435c7734f1f69aaa61fc9e61b46704e8a03d1 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:31 +0000 Subject: [PATCH 2/9] bump go.mod to Go 1.16 and run go fix --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 8239753..dd4c9d5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/libp2p/go-libp2p-pubsub-router -go 1.15 +go 1.16 require ( github.com/gogo/protobuf v1.3.1 From 0dbf28fdc7ac7cc64680a813581af0d4eb0381f0 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:32 +0000 Subject: [PATCH 3/9] run go mod tidy --- go.sum | 1 - 1 file changed, 1 deletion(-) diff --git a/go.sum b/go.sum index 9083b6b..9279d83 100644 --- a/go.sum +++ b/go.sum @@ -84,7 +84,6 @@ github.com/ipfs/go-datastore v0.1.1/go.mod h1:w38XXW9kVFNp57Zj5knbKWM2T+KOZCGDRV github.com/ipfs/go-datastore v0.4.1/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= github.com/ipfs/go-datastore v0.4.4 h1:rjvQ9+muFaJ+QZ7dN5B1MSDNQ0JVZKkkES/rMZmA8X8= github.com/ipfs/go-datastore v0.4.4/go.mod h1:SX/xMIKoCszPqp+z9JhPYCmoOoXTvaa13XEbGtsFUhA= -github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ds-badger v0.2.3/go.mod h1:pEYw0rgg3FIrywKKnL+Snr+w/LjJZVMTBRn4FS6UHUk= github.com/ipfs/go-ds-leveldb v0.4.2/go.mod h1:jpbku/YqBSsBc1qgME8BkWS4AxzF2cEu1Ii2r79Hh9s= From 3a4484564a43008e383c7f3fd5803e617affbb93 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:32 +0000 Subject: [PATCH 4/9] update .github/workflows/automerge.yml --- .github/workflows/automerge.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 32bcc2e..44fad65 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -33,7 +33,9 @@ jobs: automerge: needs: automerge-check runs-on: ubuntu-latest - if: ${{ needs.automerge-check.outputs.status == 'true' }} + # The check for the user is redundant here, as this job depends on the automerge-check job, + # but it prevents this job from spinning up, just to be skipped shortly after. + if: github.event.pull_request.user.login == 'web3-bot' && needs.automerge-check.outputs.status == 'true' steps: - name: Wait on tests uses: lewagon/wait-on-check-action@bafe56a6863672c681c3cf671f5e10b20abf2eaa # v0.2 From 0e2057aad32c472c7733b0b950b32c0885cd9ced Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:32 +0000 Subject: [PATCH 5/9] update .github/workflows/go-test.yml --- .github/workflows/go-test.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/go-test.yml b/.github/workflows/go-test.yml index 4c7138b..7010dcc 100644 --- a/.github/workflows/go-test.yml +++ b/.github/workflows/go-test.yml @@ -10,7 +10,9 @@ jobs: fail-fast: false matrix: os: [ "ubuntu", "windows", "macos" ] - go: [ "1.15.x", "1.16.x" ] + go: [ "1.16.x", "1.17.x" ] + env: + COVERAGES: "" runs-on: ${{ matrix.os }}-latest name: ${{ matrix.os}} (go ${{ matrix.go }}) steps: @@ -24,24 +26,30 @@ jobs: run: | go version go env + - name: Run repo-specific setup + uses: ./.github/actions/go-test-setup + if: hashFiles('./.github/actions/go-test-setup') != '' - name: Run tests - uses: protocol/multiple-go-modules@v1.0 + uses: protocol/multiple-go-modules@v1.2 with: - run: go test -v -coverprofile coverage.txt ./... + run: go test -v -coverprofile module-coverage.txt ./... - name: Run tests (32 bit) if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX. - uses: protocol/multiple-go-modules@v1.0 + uses: protocol/multiple-go-modules@v1.2 env: GOARCH: 386 with: run: go test -v ./... - name: Run tests with race detector if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow - uses: protocol/multiple-go-modules@v1.0 + uses: protocol/multiple-go-modules@v1.2 with: run: go test -v -race ./... + - name: Collect coverage files + shell: bash + run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV - name: Upload coverage to Codecov - uses: codecov/codecov-action@a1ed4b322b4b38cb846afb5a0ebfa17086917d27 # v1.5.0 + uses: codecov/codecov-action@51d810878be5422784e86451c0e7c14e5860ec47 # v2.0.2 with: - file: coverage.txt + files: '${{ env.COVERAGES }}' env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }} From 2aaeb864e76eea0466eae6970f8eee34b0dde4df Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:32 +0000 Subject: [PATCH 6/9] update .github/workflows/go-check.yml --- .github/workflows/go-check.yml | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/.github/workflows/go-check.yml b/.github/workflows/go-check.yml index 00ce947..6acdd48 100644 --- a/.github/workflows/go-check.yml +++ b/.github/workflows/go-check.yml @@ -8,17 +8,28 @@ jobs: unit: runs-on: ubuntu-latest name: All + env: + RUNGOGENERATE: false steps: - uses: actions/checkout@v2 with: submodules: recursive - uses: actions/setup-go@v2 with: - go-version: "1.16.x" + go-version: "1.17.x" + - name: Run repo-specific setup + uses: ./.github/actions/go-check-setup + if: hashFiles('./.github/actions/go-check-setup') != '' + - name: Read config + if: hashFiles('./.github/workflows/go-check-config.json') != '' + run: | + if jq -re .gogenerate ./.github/workflows/go-check-config.json; then + echo "RUNGOGENERATE=true" >> $GITHUB_ENV + fi - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@434f5f3816b358fe468fa83dcba62d794e7fe04b # 2021.1 (v0.2.0) + run: go install honnef.co/go/tools/cmd/staticcheck@df71e5d0e0ed317ebf43e6e59cf919430fa4b8f2 # 2021.1.1 (v0.2.1) - name: Check that go.mod is tidy - uses: protocol/multiple-go-modules@v1.0 + uses: protocol/multiple-go-modules@v1.2 with: run: | go mod tidy @@ -37,14 +48,27 @@ jobs: fi - name: go vet if: ${{ success() || failure() }} # run this step even if the previous one failed - uses: protocol/multiple-go-modules@v1.0 + uses: protocol/multiple-go-modules@v1.2 with: run: go vet ./... - name: staticcheck if: ${{ success() || failure() }} # run this step even if the previous one failed - uses: protocol/multiple-go-modules@v1.0 + uses: protocol/multiple-go-modules@v1.2 with: run: | set -o pipefail staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g' + - name: go generate + uses: protocol/multiple-go-modules@v1.2 + if: (success() || failure()) && env.RUNGOGENERATE == 'true' + with: + run: | + git clean -fd # make sure there aren't untracked files / directories + go generate ./... + # check if go generate modified or added any files + if ! $(git add . && git diff-index HEAD --exit-code --quiet); then + echo "go generated caused changes to the repository:" + git status --short + exit 1 + fi From f00b20898a21a8f1f51a7bc45872f6f073f42db3 Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:32 +0000 Subject: [PATCH 7/9] add .github/workflows/releaser.yml --- .github/workflows/releaser.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/releaser.yml diff --git a/.github/workflows/releaser.yml b/.github/workflows/releaser.yml new file mode 100644 index 0000000..51802c5 --- /dev/null +++ b/.github/workflows/releaser.yml @@ -0,0 +1,12 @@ +# File managed by web3-bot. DO NOT EDIT. +# See https://github.com/protocol/.github/ for details. + +name: Releaser +on: + push: + paths: [ 'version.json' ] + branches: [ master ] + +jobs: + releaser: + uses: protocol/.github/.github/workflows/releaser.yml@master From 73b6520ee16be76d7f11b9d698b8821d80f4219e Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:32 +0000 Subject: [PATCH 8/9] add .github/workflows/release-check.yml --- .github/workflows/release-check.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/release-check.yml diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml new file mode 100644 index 0000000..ed829b7 --- /dev/null +++ b/.github/workflows/release-check.yml @@ -0,0 +1,12 @@ +# File managed by web3-bot. DO NOT EDIT. +# See https://github.com/protocol/.github/ for details. + +name: Release Checker +on: + pull_request: + paths: [ 'version.json' ] + branches: [ master ] + +jobs: + release-check: + uses: protocol/.github/.github/workflows/release-check.yml@master From 11d9129490a8f64d1551b9a69eb0fb34323d3eaa Mon Sep 17 00:00:00 2001 From: web3-bot Date: Thu, 28 Oct 2021 20:30:32 +0000 Subject: [PATCH 9/9] add .github/workflows/tagpush.yml --- .github/workflows/tagpush.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/workflows/tagpush.yml diff --git a/.github/workflows/tagpush.yml b/.github/workflows/tagpush.yml new file mode 100644 index 0000000..d849961 --- /dev/null +++ b/.github/workflows/tagpush.yml @@ -0,0 +1,12 @@ +# File managed by web3-bot. DO NOT EDIT. +# See https://github.com/protocol/.github/ for details. + +name: Tag Push Checker +on: + push: + tags: + - v* + +jobs: + releaser: + uses: protocol/.github/.github/workflows/tagpush.yml@master