diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b022398..cd21954 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,29 +42,29 @@ jobs: - id: tag run: | - VERSION=$(svu next --tag-mode all-branches) - PREV_VERSION=$(svu current --tag-mode all-branches) - - if [ "$VERSION" = "$PREV_VERSION" ]; then - echo "no new version detected" - SAME_VERSION=true - echo "SAME_VERSION=true" >> $GITHUB_OUTPUT - else - echo "new version detected" - SAME_VERSION=false - echo "SAME_VERSION=false" >> $GITHUB_OUTPUT - - # Check if the tag already exists before creating it - if git rev-parse "v$VERSION" >/dev/null 2>&1; then - echo "Tag v$VERSION already exists, skipping tag creation." - else - git tag "$VERSION" - git push --tags - fi - fi - - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - echo "PREV_VERSION=$PREV_VERSION" >> $GITHUB_OUTPUT + VERSION=$(svu next --tag.mode all) + PREV_VERSION=$(svu current --tag.mode all) + + if [ "$VERSION" = "$PREV_VERSION" ]; then + echo "no new version detected" + SAME_VERSION=true + echo "SAME_VERSION=true" >> $GITHUB_OUTPUT + else + echo "new version detected" + SAME_VERSION=false + echo "SAME_VERSION=false" >> $GITHUB_OUTPUT + + # Check if the tag already exists before creating it + if git rev-parse "v$VERSION" >/dev/null 2>&1; then + echo "Tag v$VERSION already exists, skipping tag creation." + else + git tag "$VERSION" + git push --tags + fi + fi + + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + echo "PREV_VERSION=$PREV_VERSION" >> $GITHUB_OUTPUT goreleaser: name: Release diff --git a/Makefile b/Makefile deleted file mode 100644 index 4c792ea..0000000 --- a/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -.PHONY: license tests - -aws-regions: - aws ec2 describe-regions --region us-east-1 --all-regions --query "Regions[].RegionName" --output text > cmd/aws-regions.txt - -license: - @echo "Applying license headers..." - copywrite headers - -opensource: - @echo "Checking for open source licenses" - ~/go/bin/go-licenses report github.com/karl-cardenas-coding/go-lambda-cleanup/v2 --template=documentation/open-source.tpl > documentation/open-source.md - - -lint: ## Start Go Linter - @echo "Running Go Linter" - golangci-lint run ./... - - -build: ## Build the binary file - @echo "Building lambda function and adding version number 1.0.0" - go build -ldflags="-X 'github.com/karl-cardenas-coding/go-lambda-cleanup/v2/cmd.VersionString=1.0.0'" -o=glc -v - -tests: ## Run tests - @echo "Running tests" - go test -shuffle on -race ./... - - -tests-coverage: ## Start Go Test with code coverage - @echo "Running Go Tests with code coverage" - go test -race -shuffle on -cover -coverprofile=coverage.out -covermode=atomic ./... - -view-coverage: ## View the code coverage - @echo "Viewing the code coverage" - go tool cover -html=coverage.out - - -nil: ## Check for nil errors - @echo "Checking for nil errors" - ~/go/bin/nilaway ./... \ No newline at end of file