From 0baea0f5ccfabb05a0574b804e5f80ba2ee3b423 Mon Sep 17 00:00:00 2001 From: Soma Szelpal Date: Thu, 11 Jan 2024 11:42:05 +0100 Subject: [PATCH 1/5] update goreleaser manifest by replacing deprecated --- .goreleaser.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 326e231..71e1e8a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -2,6 +2,7 @@ before: hooks: - go mod download - go generate ./... + builds: - env: - CGO_ENABLED=0 @@ -14,6 +15,22 @@ builds: goarch: - amd64 - arm64 + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of `uname`. + name_template: >- + {{ .ProjectName }}_ + {{- title .Os }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else if eq .Arch "386" }}i386 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip + archives: - replacements: darwin: Darwin @@ -22,10 +39,13 @@ archives: 386: i386 amd64: x86_64 arm64: arm64 + checksum: name_template: 'checksums.txt' + snapshot: name_template: "{{ .Tag }}-next" + changelog: sort: asc filters: From 80468d678c1de723fa3093eb4235472cd7fbae8c Mon Sep 17 00:00:00 2001 From: Soma Szelpal Date: Thu, 11 Jan 2024 11:47:30 +0100 Subject: [PATCH 2/5] Removing old archives section leftover --- .goreleaser.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 71e1e8a..247e597 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -31,15 +31,6 @@ archives: - goos: windows format: zip -archives: -- replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 - arm64: arm64 - checksum: name_template: 'checksums.txt' From cd55144cabe00a371cd03a80bb54fce6fdc34bf2 Mon Sep 17 00:00:00 2001 From: Soma Szelpal Date: Thu, 11 Jan 2024 12:27:51 +0100 Subject: [PATCH 3/5] Replace brew.tap with brew.repository --- .goreleaser.yml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 247e597..e355518 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -4,17 +4,17 @@ before: - go generate ./... builds: -- env: - - CGO_ENABLED=0 - ldflags: - - -X github.com/get-bridge/truss-cli/cmd.Version={{.Version}} - binary: truss - goos: - - darwin - - linux - goarch: - - amd64 - - arm64 + - env: + - CGO_ENABLED=0 + ldflags: + - -X github.com/get-bridge/truss-cli/cmd.Version={{.Version}} + binary: truss + goos: + - darwin + - linux + goarch: + - amd64 + - arm64 archives: - format: tar.gz @@ -32,7 +32,7 @@ archives: format: zip checksum: - name_template: 'checksums.txt' + name_template: "checksums.txt" snapshot: name_template: "{{ .Tag }}-next" @@ -41,16 +41,15 @@ changelog: sort: asc filters: exclude: - - '^docs:' - - '^test:' + - "^docs:" + - "^test:" brews: - - - name: truss-cli + - name: truss-cli description: CLI to help manage many k8s clusters homepage: https://github.com/get-bridge/truss-cli - tap: - owner: get-bridge - name: homebrew-tap + repository: + - name: homebrew-tap + owner: get-bridge folder: Formula dependencies: - name: kubectl From ddb437a2f8418db06956f9a72d3245dba01d8a76 Mon Sep 17 00:00:00 2001 From: Soma Szelpal Date: Thu, 11 Jan 2024 12:35:42 +0100 Subject: [PATCH 4/5] Modify brew.repository to be an object instad of an array how doc incorrectly says --- .goreleaser.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index e355518..3c6cd7b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -48,8 +48,8 @@ brews: description: CLI to help manage many k8s clusters homepage: https://github.com/get-bridge/truss-cli repository: - - name: homebrew-tap - owner: get-bridge + name: homebrew-tap + owner: get-bridge folder: Formula dependencies: - name: kubectl From a95da8cc85e5f2b82f0aced5adc0fa586447ebd8 Mon Sep 17 00:00:00 2001 From: Soma Szelpal Date: Thu, 11 Jan 2024 12:48:35 +0100 Subject: [PATCH 5/5] Updated go@1.21 goreleaser@1.23 and added editorconfig --- .editorconfig | 25 +++++++++++++++ .github/workflows/bootstrap-templates.yml | 28 ++++++++--------- .github/workflows/checks.yml | 14 ++++----- .github/workflows/release.yml | 38 +++++++++++------------ .gitignore | 3 +- 5 files changed, 67 insertions(+), 41 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..71741b3 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,25 @@ +; https://editorconfig.org/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[{Makefile,go.mod,go.sum,*.go,.gitmodules}] +indent_style = tab +indent_size = 4 + +[*.md] +indent_size = 4 +trim_trailing_whitespace = false + +eclint_indent_style = unset + +[Dockerfile] +indent_size = 4 + diff --git a/.github/workflows/bootstrap-templates.yml b/.github/workflows/bootstrap-templates.yml index b55d18f..b16c989 100644 --- a/.github/workflows/bootstrap-templates.yml +++ b/.github/workflows/bootstrap-templates.yml @@ -1,23 +1,23 @@ name: Publish on: push: - tags: ['*'] - branches: ['bootstrapper'] + tags: ["*"] + branches: ["bootstrapper"] jobs: # The publish job will publish the bootstrap-templates directory to the correct S3 Bucket publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: jakejarvis/s3-sync-action@master - with: - args: --acl private --follow-symlinks - env: - # Credentials for this workflow are provisioned in the `terraform` directory - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - AWS_S3_BUCKET: truss-cli-global-config - AWS_REGION: us-east-2 - SOURCE_DIR: bootstrap-templates - DEST_DIR: bootstrap-templates \ No newline at end of file + - uses: actions/checkout@master + - uses: jakejarvis/s3-sync-action@master + with: + args: --acl private --follow-symlinks + env: + # Credentials for this workflow are provisioned in the `terraform` directory + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + AWS_S3_BUCKET: truss-cli-global-config + AWS_REGION: us-east-2 + SOURCE_DIR: bootstrap-templates + DEST_DIR: bootstrap-templates diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ae70f57..a91bd80 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v2 - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.19 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: "1.21" - - name: Go test - run: go test ./cmd/ ./truss/ -timeout 15000ms + - name: Go test + run: go test ./cmd/ ./truss/ -timeout 15000ms diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed11613..b6b2316 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ name: Release # Controls when the action will run. Triggers the workflow on push or pull request on: push: - tags: ['*'] + tags: ["*"] # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: @@ -16,24 +16,24 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 - # Unshallow required for goreleaser's changelog behavior - - name: Unshallow - run: git fetch --prune --unshallow + # Unshallow required for goreleaser's changelog behavior + - name: Unshallow + run: git fetch --prune --unshallow - # Go get'em! - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: 1.19 + # Go get'em! + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: "1.21" - # Release the thing! - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 - with: - version: latest - args: release --rm-dist - env: - GITHUB_TOKEN: ${{ secrets.INSTRUCTURE_BRIDGE_GITHUB_BOT_REPO_RW }} + # Release the thing! + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: "1.23" + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.INSTRUCTURE_BRIDGE_GITHUB_BOT_REPO_RW }} diff --git a/.gitignore b/.gitignore index 19798e0..4b1d399 100644 --- a/.gitignore +++ b/.gitignore @@ -16,10 +16,11 @@ *.out # Dependency directories (remove the comment below to include it) -# vendor/ +vendor/ dist/ .envrc +.env # Secrets /secrets