Skip to content

Commit

Permalink
core(*) - update go + deps
Browse files Browse the repository at this point in the history
  • Loading branch information
PxyUp committed Oct 27, 2024
1 parent bb141f8 commit 7522318
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 47 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fetch-depth: 2
- uses: actions/setup-go@v2
with:
go-version: '1.21.5'
go-version: '1.23.0'
- name: Run coverage
run: go test -coverprofile=coverage.txt -covermode=atomic ./pkg/...
- name: Upload coverage to Codecov
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/docker.yaml

This file was deleted.

18 changes: 14 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:

- name: Set up Go
uses: actions/setup-go@v1
with:
go-version: 1.21.5
go-version: 1.23.0
id: go

- name: Check out code into the Go module directory
Expand Down Expand Up @@ -41,4 +40,15 @@ jobs:
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-arm64
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-darwin-amd64
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-windows-amd64.exe
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-amd64
./scripts/git_release.sh github_api_token=${{ secrets.RELEASE_TOKEN }} owner=PxyUp repo=fitter tag=${{ steps.set_env.outputs.RELEASE_VERSION }} filename=./bin/fitter_cli_${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-amd64
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64

- name: Release to Docker Linux-Arm64
run: |
DOCKER_TAG=ghcr.io/pxyup/fitter:${{ steps.set_env.outputs.RELEASE_VERSION }}-linux-arm64
docker buildx build --platform linux/arm64 -t ${DOCKER_TAG} --build-arg FITTER_CLI_VERSION=${{ steps.set_env.outputs.RELEASE_VERSION }} .
docker login ghcr.io --username ${{ secrets.DOCKER_USERNAME }} --password ${{ secrets.TOKEN }} && docker push ${DOCKER_TAG}
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM --platform=linux/arm64 arm64v8/golang:1.23

RUN go install github.com/playwright-community/playwright-go/cmd/playwright@latest \
&& playwright install --with-deps
ENV GOARCH=arm64
ENV GOOS=linux

RUN go run github.com/playwright-community/playwright-go/cmd/playwright@latest install --with-deps

WORKDIR /go/src/fitter_cli

COPY . .
ARG FITTER_CLI_VERSION

RUN wget -O fitter_cli https://github.com/PxyUp/fitter/releases/download/${FITTER_CLI_VERSION}/fitter_cli_${FITTER_CLI_VERSION}-linux-arm64

RUN go mod download
RUN env GOOS=linux GOARCH=arm64 go build -o fitter_cli cmd/cli/main.go
RUN chmod u+x fitter_cli

CMD ["/fitter_cli"]
ENTRYPOINT ["/go/src/fitter_cli/fitter_cli"]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/antchfx/xmlquery v1.3.18
github.com/atotto/clipboard v0.1.4
github.com/docker/docker v23.0.1+incompatible
github.com/expr-lang/expr v1.15.8
github.com/expr-lang/expr v1.16.9
github.com/gin-gonic/gin v1.9.1
github.com/go-rod/stealth v0.4.9
github.com/go-telegram-bot-api/telegram-bot-api/v5 v5.5.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKoh
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/expr-lang/expr v1.15.8 h1:FL8+d3rSSP4tmK9o+vKfSMqqpGL8n15pEPiHcnBpxoI=
github.com/expr-lang/expr v1.15.8/go.mod h1:uCkhfG+x7fcZ5A5sXHKuQ07jGZRl6J0FCAaf2k4PtVQ=
github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI=
github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0=
github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk=
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
Expand Down
1 change: 1 addition & 0 deletions pkg/connectors/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ func (api *apiConnector) get(parsedValue builder.Interfacable, index *uint32, in
return nil, nil, err
}

api.logger.Debugw("returned response", "status_code", resp.Status, "body", string(bytes))
return resp.Header, bytes, nil
}

Expand Down
12 changes: 0 additions & 12 deletions pkg/utils/expression.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,6 @@ const (

var (
defEnv = map[string]interface{}{
"reverse": func(s []interface{}) []interface{} {
a := make([]interface{}, len(s))
copy(a, s)

for i := len(a)/2 - 1; i >= 0; i-- {
opp := len(a) - 1 - i
a[i], a[opp] = a[opp], a[i]
}

return a
},
"FNull": builder.NullValue,
"FNil": nil,
"isNull": func(value interface{}) bool {
Expand Down Expand Up @@ -55,7 +44,6 @@ func extendEnv(env map[string]interface{}, result builder.Interfacable, index *u

func ProcessExpression(expression string, result builder.Interfacable, index *uint32, input builder.Interfacable) (builder.Interfacable, error) {
env := extendEnv(defEnv, result, index)

program, err := expr.Compile(Format(expression, result, index, input), expr.Env(env))
if err != nil {
return nil, err
Expand Down

0 comments on commit 7522318

Please sign in to comment.