From 43a7514b42397103f1a0a0e55bdafc0f93994f9b Mon Sep 17 00:00:00 2001 From: Andrea Angiolillo Date: Fri, 26 Apr 2024 14:19:07 +0100 Subject: [PATCH] CLOUDP-245948: Rename openapicli to foascli (#22) --- .github/workflows/release-cli.yml | 4 ++-- tools/cli/.goreleaser.yml | 12 ++++++------ tools/cli/Makefile | 6 +++--- tools/cli/cmd/{openapicli.go => foascli.go} | 0 tools/cli/internal/cli/root/openapi/builder.go | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) rename tools/cli/cmd/{openapicli.go => foascli.go} (100%) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index baf25259e..00e05f440 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -44,7 +44,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: labels: failed-release - title: "Releasing openapicli v${{ inputs.version_number }} failed at the tag creation step :scream_cat:" + title: "Releasing foascli v${{ inputs.version_number }} failed at the tag creation step :scream_cat:" body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} run-tests: @@ -87,5 +87,5 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: labels: failed-release - title: "Releasing openapicli v${{ inputs.version_number }} failed at the goreleaser step :scream_cat:" + title: "Releasing foascli v${{ inputs.version_number }} failed at the goreleaser step :scream_cat:" body: See https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} diff --git a/tools/cli/.goreleaser.yml b/tools/cli/.goreleaser.yml index 15ca5b279..d04ac9c0a 100644 --- a/tools/cli/.goreleaser.yml +++ b/tools/cli/.goreleaser.yml @@ -1,6 +1,6 @@ # Visit https://goreleaser.com for documentation on how to customize this # behavior. -project_name: openapicli +project_name: foascli before: hooks: # this is just an example and not a requirement for provider building/publishing @@ -9,8 +9,8 @@ builds: - <<: &build_defaults env: - CGO_ENABLED=0 - binary: bin/openapicli - main: ./cmd/openapicli.go + binary: bin/foascli + main: ./cmd/foascli.go ldflags: - -s -w -X github.com/mongodb/openapi/tools/cli/internal/version.Version={{.Version}} -X github.com/mongodb/openapi/tools/cli/internal/version.GitCommit={{.FullCommit}} id: linux @@ -34,13 +34,13 @@ gomod: # https://goreleaser.com/customization/verifiable_builds/ archives: - id: linux_archives - name_template: mongodb-openapi-cli_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }} + name_template: mongodb-foas-cli_{{ .Version }}_{{ .Os }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }} builds: [linux] wrap_in_directory: true format: tar.gz rlcp: false - id: macos - name_template: mongodb-openapi-cli_{{ .Version }}_{{- if eq .Os "darwin" }}macos{{- else }}{{ .Os }}{{ end }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }} + name_template: mongodb-foas-cli_{{ .Version }}_{{- if eq .Os "darwin" }}macos{{- else }}{{ .Os }}{{ end }}_{{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end }} builds: [macos] format: zip wrap_in_directory: false @@ -59,6 +59,6 @@ changelog: release: prerelease: auto - name_template: "OpenAPI CLI {{.Version}}" + name_template: "FOAS CLI {{.Version}}" diff --git a/tools/cli/Makefile b/tools/cli/Makefile index 448e38590..93d0533b9 100644 --- a/tools/cli/Makefile +++ b/tools/cli/Makefile @@ -2,7 +2,7 @@ GOLANGCI_VERSION=v1.56.2 SOURCE_FILES?=./cmd -BINARY_NAME=openapicli +BINARY_NAME=foascli VERSION=v0.0.1 GIT_SHA?=$(shell git rev-parse HEAD) DESTINATION=./bin/$(BINARY_NAME) @@ -39,13 +39,13 @@ fmt: ### Format all go files with goimports and gofmt .PHONY: build build: - @echo "==> Building openapicli binary" + @echo "==> Building foascli binary" go build -ldflags "$(LINKER_FLAGS)" -o $(DESTINATION) $(SOURCE_FILES) .PHONY: build-debug build-debug: - @echo "==> Building openapicli binary for debugging" + @echo "==> Building foascli binary for debugging" go build -gcflags="$(DEBUG_FLAGS)" -ldflags "$(LINKER_FLAGS)" -o $(DESTINATION) $(SOURCE_FILES) .PHONY: lint diff --git a/tools/cli/cmd/openapicli.go b/tools/cli/cmd/foascli.go similarity index 100% rename from tools/cli/cmd/openapicli.go rename to tools/cli/cmd/foascli.go diff --git a/tools/cli/internal/cli/root/openapi/builder.go b/tools/cli/internal/cli/root/openapi/builder.go index 419e07ba4..7bf267668 100644 --- a/tools/cli/internal/cli/root/openapi/builder.go +++ b/tools/cli/internal/cli/root/openapi/builder.go @@ -24,8 +24,8 @@ import ( ) const ( - ToolName = "openapicli" - verTemplate = `openapicli version: %s + ToolName = "foascli" + verTemplate = `foascli version: %s git version: %s Go version: %s os: %s @@ -43,7 +43,7 @@ func Builder() *cobra.Command { Use: ToolName, Short: "CLI tool to validate and merge your Open API Specifications", Example: ` # Display the help menu for the merge command: - openapicli merge --help + foascli merge --help `, SilenceUsage: true, }