diff --git a/.github/workflows/binary.yml b/.github/workflows/binary.yml index 8e91cea..bb36fba 100644 --- a/.github/workflows/binary.yml +++ b/.github/workflows/binary.yml @@ -9,14 +9,14 @@ jobs: publish: runs-on: ubuntu-latest steps: - - name: "Setup go" - uses: actions/setup-go@v4 - - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + - name: "Setup go" + uses: actions/setup-go@v4 + - name: "Build binary" run: | make binary diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml index d9ce3a6..9af328c 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -12,26 +12,29 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - name: Log in to the ghcr - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Log in to the docker - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ github.repository }} @@ -42,7 +45,7 @@ jobs: - name: Docker meta for debug version if: ${{ github.ref == 'refs/heads/master' }} id: debug-meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: | ghcr.io/${{ github.repository }} @@ -52,7 +55,7 @@ jobs: - name: Build and push image if: ${{ steps.meta.outputs.tags != '' }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "." push: true @@ -60,7 +63,7 @@ jobs: - name: "[debug version] Build and push image" if: ${{ github.ref == 'refs/heads/master' }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: "." push: true diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index cb9ef0f..16256ee 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -13,12 +13,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version-file: "go.mod" + go-version-file: 'go.mod' - name: golangci-lint uses: golangci/golangci-lint-action@v3 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index f30cdf4..f9e0790 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -19,14 +19,14 @@ jobs: echo "VERSION=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: - go-version-file: "go.mod" + go-version-file: 'go.mod' - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 with: version: latest - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0b81b42..d4a656f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,11 +11,10 @@ on: jobs: unittests: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v4 with: - go-version-file: "go.mod" + go-version-file: 'go.mod' - name: unit tests run: make test diff --git a/.goreleaser.yml b/.goreleaser.yml index 77d0a2e..c0caaca 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -51,12 +51,14 @@ builds: - amd64 archives: - - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + - id: agent + name_template: >- + {{- .ProjectName }}_{{- .Version }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end -}} checksum: name_template: 'checksums.txt' diff --git a/go.mod b/go.mod index 9a598ec..59ed114 100644 --- a/go.mod +++ b/go.mod @@ -13,8 +13,8 @@ require ( github.com/panjf2000/ants/v2 v2.7.3 github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 - github.com/projecteru2/core v0.0.0-20230515031536-7fdaea78417e - github.com/projecteru2/libyavirt v0.0.0-20230725071905-9785e974d625 + github.com/projecteru2/core v0.0.0-20231011041458-107cf103854d + github.com/projecteru2/libyavirt v0.0.0-20230921032447-a617cf0c746c github.com/prometheus/client_golang v1.15.0 github.com/rs/zerolog v1.29.1 github.com/shirou/gopsutil v3.21.11+incompatible @@ -45,7 +45,6 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/google/uuid v1.3.0 // indirect - github.com/juju/errors v1.0.0 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect diff --git a/go.sum b/go.sum index b35ca93..010bef3 100644 --- a/go.sum +++ b/go.sum @@ -145,8 +145,6 @@ github.com/jinzhu/configor v1.2.1/go.mod h1:nX89/MOmDba7ZX7GCyU/VIaQ2Ar2aizBl2d3 github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/errors v1.0.0 h1:yiq7kjCLll1BiaRuNY53MGI0+EQ3rF6GB+wvboZDefM= -github.com/juju/errors v1.0.0/go.mod h1:B5x9thDqx0wIMH3+aLIMP9HjItInYWObRovoCFM5Qe8= github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8= github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE= @@ -224,10 +222,10 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/projecteru2/core v0.0.0-20230515031536-7fdaea78417e h1:7gx3ZANhgXc3yPjecJi/dPhZrOh3LGjn8SI/VK4siQY= -github.com/projecteru2/core v0.0.0-20230515031536-7fdaea78417e/go.mod h1:H7AOnfGM0xI7hYMLG8JpqRVCI+flEX2w/Ro29zSwrQw= -github.com/projecteru2/libyavirt v0.0.0-20230725071905-9785e974d625 h1:liDnxQ0JxvOLC0/tUVRlz4tG9r/xbcp1NXgNVNBJsLQ= -github.com/projecteru2/libyavirt v0.0.0-20230725071905-9785e974d625/go.mod h1:N41KaKmqbailweGs4x/mt2H0O0Y7MizObZQ+igLdzpw= +github.com/projecteru2/core v0.0.0-20231011041458-107cf103854d h1:XRjiqmESXC43D4bAGVpXbEB9N4Xd1Gk4Ewryc6BICEI= +github.com/projecteru2/core v0.0.0-20231011041458-107cf103854d/go.mod h1:fxKSjK6GhlCiV+e1eBtnJpAB7RqM021ZKIB0iZeYOXo= +github.com/projecteru2/libyavirt v0.0.0-20230921032447-a617cf0c746c h1:zwbTS+K8aKgXHU/7YVU4okk7fqrAE3W+yJjMRE3qdQA= +github.com/projecteru2/libyavirt v0.0.0-20230921032447-a617cf0c746c/go.mod h1:+EcdWF8KyTf2u8Zxu3397nSmalCSmpuxvGwcX1g3RL0= github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=