From 6dc95b086886148653af05dc63f630f67d64c4de Mon Sep 17 00:00:00 2001 From: ysicing Date: Fri, 24 May 2024 16:55:16 +0800 Subject: [PATCH] chore: update file configurations and workflows - Update `GO_VERSION` environment variable from `'1.21'` to `'1.22'` in `.github/workflows/release.yml` - Remove `preRelease` job in `.github/workflows/test.yml` - Delete `.goreleaser.dev.yaml` file - Add `extra_files` section with a glob pattern in `.goreleaser.yaml` Signed-off-by: ysicing --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 20 ----------- .goreleaser.dev.yaml | 62 ----------------------------------- .goreleaser.yaml | 2 ++ 4 files changed, 3 insertions(+), 83 deletions(-) delete mode 100644 .goreleaser.dev.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c79c548c..c6d63a84 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: env: TZ: Asia/Shanghai - GO_VERSION: '1.21' + GO_VERSION: '1.22' permissions: write-all diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e5464c63..d41fa581 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -80,23 +80,3 @@ jobs: if: always() with: sarif_file: 'trivy-results.sarif' - - preRelease: - name: "build" - timeout-minutes: 20 - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: ${{ env.GO_VERSION }} - check-latest: true - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v5 - with: - version: latest - args: release --clean --config .goreleaser.dev.yaml --skip validate,announce - env: - GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.goreleaser.dev.yaml b/.goreleaser.dev.yaml deleted file mode 100644 index 44c40396..00000000 --- a/.goreleaser.dev.yaml +++ /dev/null @@ -1,62 +0,0 @@ -# This is an example .goreleaser.yml file with some sensible defaults. -# Make sure to check the documentation at https://goreleaser.com -project_name: qcadmin - -env: - - GO111MODULE=on - -before: - hooks: - - task generate - - ./hack/scripts/gencompletions.sh - - ./hack/scripts/genmanpages.sh - -builds: - - ldflags: - - -w -s -X github.com/easysoft/qcadmin/common.Version={{.Summary}} - - -X github.com/easysoft/qcadmin/common.BuildDate={{.CommitDate}} - - -X github.com/easysoft/qcadmin/common.GitCommitHash={{.ShortCommit}} - - -X k8s.io/client-go/pkg/version.gitVersion={{.Summary}} - - -X k8s.io/client-go/pkg/version.gitCommit={{.FullCommit}} - - -X k8s.io/client-go/pkg/version.gitTreeState=dirty - - -X k8s.io/client-go/pkg/version.buildDate={{.CommitDate}} - - -X k8s.io/client-go/pkg/version.gitMajor=1 - - -X k8s.io/client-go/pkg/version.gitMinor=24 - - -X k8s.io/component-base/version.gitVersion={{.Summary}} - - -X k8s.io/component-base/version.gitCommit={{.FullCommit}} - - -X k8s.io/component-base/version.gitTreeState=dirty - - -X k8s.io/component-base/version.gitMajor=1 - - -X k8s.io/component-base/version.gitMinor=24 - - -X k8s.io/component-base/version.buildDate={{.CommitDate}} - env: - - CGO_ENABLED=0 - goos: - - linux - goarch: - - amd64 - - arm64 - main: main.go - id: qcadmin - binary: qcadmin - -archives: - - format: binary - name_template: "qcadmin_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" - -checksum: - name_template: 'checksums.txt' - -snapshot: - name_template: "{{ .Version }}-snapshot-{{ .ShortCommit }}" - -release: - target_commitish: "{{ .FullCommit }}" - prerelease: true - replace_existing_draft: true - mode: replace - make_latest: false - header: | - ## Commit Auto build - footer: | - Those were the changes on {{ .Commit }}! - diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a5ffefb8..e4c6b58a 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -157,3 +157,5 @@ release: prerelease: auto replace_existing_draft: true mode: replace + extra_files: + - glob: version.json