From 8b2e958f5c93ed99bc0369017b65d30670143890 Mon Sep 17 00:00:00 2001 From: Nirdosh Gautam Date: Fri, 16 Aug 2024 00:32:49 +0545 Subject: [PATCH] upgrade to goreleaser v2 --- .github/workflows/release.yaml | 10 +++++----- .gitignore | 1 + .goreleaser.yml | 21 +++++++++++++++------ Makefile | 2 +- test/docker-compose.yaml | 6 +++--- 5 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 066e987..6677edc 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,21 +11,21 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v5 with: - go-version: 1.16 + go-version: 1.22 - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v6 with: # either 'goreleaser' (default) or 'goreleaser-pro' distribution: goreleaser - version: latest + version: "~> v2" args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }} diff --git a/.gitignore b/.gitignore index f6436c7..b941ecb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ stack_teardown_details.json cfn-teardown +dist diff --git a/.goreleaser.yml b/.goreleaser.yml index 293bb8a..4657dfe 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,4 +1,5 @@ # For more info about this file, check the documentation at http://goreleaser.com +version: 2 release: github: owner: nirdosh17/cfn-teardown @@ -17,12 +18,20 @@ builds: - windows - darwin archives: - - replacements: - darwin: Darwin - linux: Linux - windows: Windows - 386: i386 - amd64: x86_64 + - 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 + checksum: name_template: 'checksums.txt' snapshot: diff --git a/Makefile b/Makefile index f34d3bc..2351362 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ build: ## install deps and build binary run: build ## build and run binary ./cfn-teardown -test.start: ## start integration test +test.start: test.stop ## start integration test docker build --platform linux/amd64 -t cfn-teardown-test -f test/Dockerfile . docker compose -f test/docker-compose.yaml up --abort-on-container-exit --remove-orphans diff --git a/test/docker-compose.yaml b/test/docker-compose.yaml index 320ac30..b54d025 100644 --- a/test/docker-compose.yaml +++ b/test/docker-compose.yaml @@ -10,9 +10,9 @@ services: localstack: container_name: localstack-main image: localstack/localstack - ports: - - "127.0.0.1:4566:4566" # LocalStack Gateway - - "127.0.0.1:4510-4559:4510-4559" # external services port range + # ports: + # - "127.0.0.1:4566:4566" # LocalStack Gateway + # - "127.0.0.1:4510-4559:4510-4559" # external services port range environment: # LocalStack configuration: https://docs.localstack.cloud/references/configuration/ - DEBUG=${DEBUG:-0}