fix: how new go-libp2p versions are added to perf (#294)
This commit is contained in:
parent
2980863ebc
commit
353e2db77c
|
@ -27,7 +27,8 @@ jobs:
|
|||
uses: actions/checkout@v3
|
||||
- name: Configure git
|
||||
run: |
|
||||
git fetch $BRANCH && git checkout $BRANCH && git rebase $GITHUB_REF -X theirs || git checkout -b $BRANCH
|
||||
git fetch origin $BRANCH && git checkout $BRANCH || git checkout -b $BRANCH
|
||||
git rebase $GITHUB_REF -X theirs || git rebase --abort
|
||||
git config --global user.email $GITHUB_ACTOR@users.noreply.github.com
|
||||
git config --global user.name $GITHUB_ACTOR
|
||||
- id: go
|
||||
|
@ -62,6 +63,9 @@ jobs:
|
|||
git add .
|
||||
git commit -m "chore: add go-libp2p@$REMOTE_VERSION to $DIR"
|
||||
git push origin $BRANCH --force
|
||||
# create a PR if an open one doesn't exist yet
|
||||
if [[ $(gh pr list --state open --base $GITHUB_REF --head $BRANCH | wc -l) -eq 0 ]]; then
|
||||
gh pr create --title "chore: add go-libp2p@$REMOTE_VERSION to $DIR" --body "This PR adds go-libp2p@$REMOTE_VERSION to $DIR" --head $BRANCH --base $GITHUB_REF
|
||||
fi
|
||||
gh workflow run perf.yml --ref $BRANCH
|
||||
working-directory: ${{ env.DIR }}
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
perf
|
||||
.cache
|
||||
v0.29
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
# Build Go Binary
|
||||
FROM golang:1.20-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY *.go ./
|
||||
RUN go build -o perf .
|
||||
|
||||
FROM alpine
|
||||
|
||||
COPY --from=builder /app/perf /app/perf
|
||||
|
||||
ENTRYPOINT [ "/app/perf" ]
|
|
@ -3,10 +3,9 @@ GO_FILES := $(wildcard *.go)
|
|||
all: perf
|
||||
|
||||
perf: $(GO_FILES)
|
||||
docker run --rm --user "$(shell id -u):$(shell id -g)" -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp -e GOCACHE=/usr/src/myapp/.cache golang:1.20 go build -o perf .
|
||||
docker run --rm --user "$(shell id -u):$(shell id -g)" -v "$(shell pwd)":/usr/src/myapp -w /usr/src/myapp -e GOCACHE=/usr/src/myapp/.cache golang:$(shell awk '/^go [0-9]+\.[0-9]+$$/ {print $$2}' go.mod) go build -o perf .
|
||||
|
||||
clean:
|
||||
rm v0.29
|
||||
rm -r .cache
|
||||
rm perf
|
||||
|
||||
|
|
Loading…
Reference in New Issue