Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix build ci #2

Merged
merged 8 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,8 @@ permissions:
contents: write

jobs:
build-package:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Set up Go 1.x.y
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}

- name: Checkout codebase
uses: actions/checkout@v3

- name: Build Package
run: |
make build
goreleaser:
runs-on: ubuntu-latest
needs: build-package
steps:
- uses: actions/checkout@v3
with:
Expand Down
18 changes: 9 additions & 9 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ builds:
- amd64
ldflags:
- -s -w
- -X github.com/easegress-io/easegress/v2/pkg/version.RELEASE={{ .Tag }}
- -X github.com/easegress-io/easegress/v2/pkg/version.COMMIT={{.Commit}}
- -X github.com/easegress-io/easegress/v2/pkg/version.REPO=chainbase-labs/easegress-providerproxy
- -X github.com/megaease/easegress/v2/pkg/version.RELEASE={{ .Tag }}
- -X github.com/megaease/easegress/v2/pkg/version.COMMIT={{.Commit}}
- -X github.com/megaease/easegress/v2/pkg/version.REPO=chainbase-labs/easegress-providerproxy

- id: builder
main: cmd/builder/main.go
Expand All @@ -49,9 +49,9 @@ builds:
- amd64
ldflags:
- -s -w
- -X github.com/easegress-io/easegress/v2/pkg/version.RELEASE={{ .Tag }}
- -X github.com/easegress-io/easegress/v2/pkg/version.COMMIT={{.Commit}}
- -X github.com/easegress-io/easegress/v2/pkg/version.REPO=chainbase-labs/easegress-providerproxy
- -X github.com/megaease/easegress/v2/pkg/version.RELEASE={{ .Tag }}
- -X github.com/megaease/easegress/v2/pkg/version.COMMIT={{.Commit}}
- -X github.com/megaease/easegress/v2/pkg/version.REPO=chainbase-labs/easegress-providerproxy

- id: server
main: cmd/server/main.go
Expand All @@ -64,9 +64,9 @@ builds:
- amd64
ldflags:
- -s -w
- -X github.com/easegress-io/easegress/v2/pkg/version.RELEASE={{ .Tag }}
- -X github.com/easegress-io/easegress/v2/pkg/version.COMMIT={{.Commit}}
- -X github.com/easegress-io/easegress/v2/pkg/version.REPO=chainbase-labs/easegress-providerproxy
- -X github.com/megaease/easegress/v2/pkg/version.RELEASE={{ .Tag }}
- -X github.com/megaease/easegress/v2/pkg/version.COMMIT={{.Commit}}
- -X github.com/megaease/easegress/v2/pkg/version.REPO=chainbase-labs/easegress-providerproxy

archives:
- id: easegress
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ IMAGE_NAME?=h00000000s/easegress
BUILDER_IMAGE_NAME?=megaease/golang:1.21.7-alpine

# Version
RELEASE?=v2.7.3-rc1
RELEASE?=$${RELEASE:-$(shell git describe --tags)}

# Git Related
GIT_REPO_INFO=$(shell cd ${MKFILE_DIR} && git config --get remote.origin.url)
Expand Down
2 changes: 0 additions & 2 deletions pkg/filters/proxies/providerproxy/providerproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@
)

func (m *ProviderProxy) SelectNode() (*url.URL, error) {

if m.providerSelector == nil {
urls := m.spec.Urls
randomIndex := rand.Intn(len(urls))
rpcUrl := urls[randomIndex]
return url.Parse(rpcUrl)
}

rpcUrl, err := m.providerSelector.ChooseServer()
if err != nil {
return nil, err
Expand All @@ -58,7 +56,7 @@

logger.Infof("select rpc provider: %s", reqUrl.String())
req := ctx.GetInputRequest().(*httpprot.Request)
forwardReq, err := http.NewRequestWithContext(req.Context(), req.Method(), reqUrl.String(), req.GetPayload())

Check failure on line 59 in pkg/filters/proxies/providerproxy/providerproxy.go

View workflow job for this annotation

GitHub Actions / analysis

SA4006: this value of `err` is never used (staticcheck)
for key := range req.HTTPHeader() {
forwardReq.Header.Add(key, req.HTTPHeader().Get(key))
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ fi
GITHUB_URL=https://github.com/chainbase-labs/easegress-providerproxy
LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' ${GITHUB_URL}/releases/latest)
LATEST_VERSION=$(echo $LATEST_RELEASE | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')
ARTIFACT="easegress-${LATEST_VERSION}-${OS}-${ARCH}.tar.gz"
ARTIFACT="easegress-providerproxy-${LATEST_VERSION}-${OS}-${ARCH}.tar.gz"
ARTIFACT_URL="${GITHUB_URL}/releases/download/${LATEST_VERSION}/${ARTIFACT}"


Expand Down
Loading