From 2c7e0056e2240db31c15397248d2d2260739488b Mon Sep 17 00:00:00 2001 From: Peng Zhefu Date: Wed, 11 Oct 2023 13:43:27 +0800 Subject: [PATCH] upgrade actions and core --- .github/workflows/binary.yml | 8 ++++---- .github/workflows/dockerimage.yml | 16 ++++++++-------- .github/workflows/golangci-lint.yml | 4 ++-- .github/workflows/goreleaser.yml | 8 ++++---- .github/workflows/test.yml | 7 ++----- .goreleaser.yml | 14 ++++++++------ README.md | 1 - go.mod | 2 +- go.sum | 4 ++-- 9 files changed, 31 insertions(+), 33 deletions(-) diff --git a/.github/workflows/binary.yml b/.github/workflows/binary.yml index 8fbb564..126eb34 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 7c60e44..7ee036c 100644 --- a/.github/workflows/dockerimage.yml +++ b/.github/workflows/dockerimage.yml @@ -16,25 +16,25 @@ jobs: with: fetch-depth: 0 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 - name: Log in to the ghcr - uses: docker/login-action@v2 + 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@v2 + 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 }} @@ -45,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 }} @@ -55,7 +55,7 @@ jobs: - name: Build and push image if: ${{ steps.meta.outputs.tags != '' }} - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: "." platforms: linux/amd64,linux/arm64 @@ -64,7 +64,7 @@ jobs: - name: "[debug version] Build and push image" if: ${{ github.ref == 'refs/heads/master' }} - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: "." platforms: linux/amd64,linux/arm64 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 71ace56..16256ee 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -13,10 +13,10 @@ 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' diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 19f4a09..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' - 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 3b92571..d4a656f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,13 +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' - - name: unit tests run: make test diff --git a/.goreleaser.yml b/.goreleaser.yml index 2c661de..754017e 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -21,12 +21,14 @@ builds: - amd64 archives: - - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + - id: cli + 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/README.md b/README.md index 34cf33d..cd8e5c4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ CLI ===== ![](https://github.com/projecteru2/cli/workflows/goreleaser/badge.svg) ![](https://github.com/projecteru2/cli/workflows/golangci-lint/badge.svg) -[![Codacy Badge](https://app.codacy.com/project/badge/Grade/e9a4c445afb549fea950b4353197e859)](https://www.codacy.com/gh/projecteru2/cli?utm_source=github.com&utm_medium=referral&utm_content=projecteru2/cli&utm_campaign=Badge_Grade) CLI for Eru. diff --git a/go.mod b/go.mod index b9dcb4c..b74a101 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/jedib0t/go-pretty/v6 v6.4.6 github.com/juju/errors v1.0.0 github.com/pkg/term v1.1.0 - github.com/projecteru2/core v0.0.0-20231010184432-b89f6dbbdd1c + github.com/projecteru2/core v0.0.0-20231011045726-f834c8786ef0 github.com/sethgrid/curse v0.0.0-20181231162520-d4ee583ebf0f github.com/sethvargo/go-signalcontext v0.2.1 github.com/sirupsen/logrus v1.9.0 diff --git a/go.sum b/go.sum index 0d5d61e..8d26119 100644 --- a/go.sum +++ b/go.sum @@ -265,8 +265,8 @@ github.com/pkg/term v1.1.0 h1:xIAAdCMh3QIAy+5FrE8Ad8XoDhEU4ufwbaSozViP9kk= github.com/pkg/term v1.1.0/go.mod h1:E25nymQcrSllhX42Ok8MRm1+hyBdHY0dCeiKZ9jpNGw= 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/projecteru2/core v0.0.0-20231010184432-b89f6dbbdd1c h1:t1aE9WeRcKrxyAQkzbZtacChr5cbEZ2yGAUxLkuTLiQ= -github.com/projecteru2/core v0.0.0-20231010184432-b89f6dbbdd1c/go.mod h1:fxKSjK6GhlCiV+e1eBtnJpAB7RqM021ZKIB0iZeYOXo= +github.com/projecteru2/core v0.0.0-20231011045726-f834c8786ef0 h1:+DdklqQduXehUGnJUiiFrjyDDuQnODEyvSGYSbAtIdc= +github.com/projecteru2/core v0.0.0-20231011045726-f834c8786ef0/go.mod h1:fxKSjK6GhlCiV+e1eBtnJpAB7RqM021ZKIB0iZeYOXo= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.1.0/go.mod h1:I1FGZT9+L76gKKOs5djB6ezCbFQP1xR9D75/vuwEF3g=