From 2e4ba723442cfe4c4019366bc1e5508a7667ad91 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:46:48 +0100 Subject: [PATCH 01/17] initial Go files --- cmd/plugin/main.go | 37 +++++++++++++++++++++++++++++++++++-- go.mod | 7 +++++++ go.sum | 10 ++++++++++ internal/cli/hello/hello.go | 17 +++++++++++++++++ 4 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 go.sum create mode 100644 internal/cli/hello/hello.go diff --git a/cmd/plugin/main.go b/cmd/plugin/main.go index 6d54162..bd82c56 100644 --- a/cmd/plugin/main.go +++ b/cmd/plugin/main.go @@ -1,7 +1,40 @@ package main -import "fmt" +import ( + "fmt" + "os" + + "github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/cli/hello" + "github.com/spf13/cobra" +) func main() { - fmt.Println("WIP - Placeholder for CLI plugin entrypoint") + terraformCmd := &cobra.Command{ + Use: "terraform", + Short: "Root command of the Atlas CLI plugin for MongoDB Atlas Provider", + } + + terraformCmd.AddCommand( + hello.Builder(), + ) + + completionOption := &cobra.CompletionOptions{ + DisableDefaultCmd: true, + DisableNoDescFlag: true, + DisableDescriptions: true, + HiddenDefaultCmd: true, + } + rootCmd := &cobra.Command{ + Aliases: []string{"tf"}, + DisableFlagParsing: true, + DisableAutoGenTag: true, + DisableSuggestions: true, + CompletionOptions: *completionOption, + } + rootCmd.AddCommand(terraformCmd) + + if err := rootCmd.Execute(); err != nil { + fmt.Println(err) + os.Exit(1) + } } diff --git a/go.mod b/go.mod index 1698ba9..2010e5f 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,10 @@ module github.com/mongodb-labs/atlas-cli-plugin-terraform go 1.23.4 + +require github.com/spf13/cobra v1.8.1 + +require ( + github.com/inconshreveable/mousetrap v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..912390a --- /dev/null +++ b/go.sum @@ -0,0 +1,10 @@ +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= +github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= +github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/internal/cli/hello/hello.go b/internal/cli/hello/hello.go new file mode 100644 index 0000000..7019f51 --- /dev/null +++ b/internal/cli/hello/hello.go @@ -0,0 +1,17 @@ +package hello + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +func Builder() *cobra.Command { + return &cobra.Command{ + Use: "hello", + Short: "The Hello World command", + Run: func(_ *cobra.Command, _ []string) { + fmt.Println("Hello World, Terraform! This command will be eventually deleted.") + }, + } +} From 0a904befa086fde026a137144a7ef24449813db9 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:53:18 +0100 Subject: [PATCH 02/17] readme info --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index 9616989..b70aa53 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,23 @@ This repository contains the Atlas CLI plugin for MongoDB Atlas Provider. WIP + +## Installing + +Install the [Atlas CLI](https://github.com/mongodb/mongodb-atlas-cli) if you don't have done it yet. + +Install the plugin by running: +```bash +atlas plugin install github.com/mongodb-labs/atlas-cli-plugin-terraform +``` + +## Usage + + +## Contributing + +See our [CONTRIBUTING.md](CONTRIBUTING.md) guide. + +## License + +MongoDB Atlas CLI is released under the Apache 2.0 license. See [LICENSE.md](LICENSE.md) From 11463cd6a04c54495f7d2302ea78fee15925e1f4 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 10 Jan 2025 12:53:57 +0100 Subject: [PATCH 03/17] typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b70aa53..9ce8f5e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ WIP ## Installing -Install the [Atlas CLI](https://github.com/mongodb/mongodb-atlas-cli) if you don't have done it yet. +Install the [Atlas CLI](https://github.com/mongodb/mongodb-atlas-cli) if you haven't done it yet. Install the plugin by running: ```bash From 9d23433a44fd36bc17b024c8aca1a55abdddec56 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:01:00 +0100 Subject: [PATCH 04/17] correct alias --- cmd/plugin/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/plugin/main.go b/cmd/plugin/main.go index bd82c56..d10886f 100644 --- a/cmd/plugin/main.go +++ b/cmd/plugin/main.go @@ -12,6 +12,7 @@ func main() { terraformCmd := &cobra.Command{ Use: "terraform", Short: "Root command of the Atlas CLI plugin for MongoDB Atlas Provider", + Aliases: []string{"tf"}, } terraformCmd.AddCommand( @@ -25,7 +26,6 @@ func main() { HiddenDefaultCmd: true, } rootCmd := &cobra.Command{ - Aliases: []string{"tf"}, DisableFlagParsing: true, DisableAutoGenTag: true, DisableSuggestions: true, From 6c8259db3c8a2bd8c12321b15cc72b97ccfc4263 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:07:52 +0100 Subject: [PATCH 05/17] add Terraform word in docs --- CONTRIBUTING.md | 2 +- README.md | 4 ++-- cmd/plugin/main.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e4dc21b..9dbfc15 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ -# Contributing to Atlas CLI plugin for MongoDB Atlas Provider +# Contributing to the Atlas CLI plugin for Terraform's MongoDB Atlas Provider WIP diff --git a/README.md b/README.md index 9ce8f5e..84f05ed 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# Atlas CLI plugin for MongoDB Atlas Provider +# Atlas CLI plugin for Terraform's MongoDB Atlas Provider [![Code Health](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/actions/workflows/code-health.yml/badge.svg)](https://github.com/mongodb-labs/atlas-cli-plugin-terraform/actions/workflows/code-health.yml) -This repository contains the Atlas CLI plugin for MongoDB Atlas Provider. +This repository contains the Atlas CLI plugin for Terraform's MongoDB Atlas Provider. WIP diff --git a/cmd/plugin/main.go b/cmd/plugin/main.go index d10886f..f7f8674 100644 --- a/cmd/plugin/main.go +++ b/cmd/plugin/main.go @@ -11,7 +11,7 @@ import ( func main() { terraformCmd := &cobra.Command{ Use: "terraform", - Short: "Root command of the Atlas CLI plugin for MongoDB Atlas Provider", + Short: "Root command of the Atlas CLI plugin for Terraform's MongoDB Atlas Provider", Aliases: []string{"tf"}, } From 515759ba66c91f878f3e1560b1a3fbd0fe2a88d9 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:09:16 +0100 Subject: [PATCH 06/17] fix linter --- cmd/plugin/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/plugin/main.go b/cmd/plugin/main.go index f7f8674..7463d0c 100644 --- a/cmd/plugin/main.go +++ b/cmd/plugin/main.go @@ -10,9 +10,9 @@ import ( func main() { terraformCmd := &cobra.Command{ - Use: "terraform", - Short: "Root command of the Atlas CLI plugin for Terraform's MongoDB Atlas Provider", - Aliases: []string{"tf"}, + Use: "terraform", + Short: "Root command of the Atlas CLI plugin for Terraform's MongoDB Atlas Provider", + Aliases: []string{"tf"}, } terraformCmd.AddCommand( From 230137ac4b108397a93a250f83755d5e057566fd Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Fri, 10 Jan 2025 18:17:34 +0100 Subject: [PATCH 07/17] local dev --- .gitignore | 1 + CONTRIBUTING.md | 8 +++++++ GNUmakefile | 18 -------------- Makefile | 55 +++++++++++++++++++++++++++++++++++++++++++ cmd/plugin/main.go | 2 +- manifest.template.yml | 12 ++++++++++ 6 files changed, 77 insertions(+), 19 deletions(-) delete mode 100644 GNUmakefile create mode 100644 Makefile create mode 100644 manifest.template.yml diff --git a/.gitignore b/.gitignore index ba077a4..a9d0947 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ bin +bin-plugin diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9dbfc15..109a7bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,11 @@ # Contributing to the Atlas CLI plugin for Terraform's MongoDB Atlas Provider WIP + +## Building + +You can build the binary plugin by running `make build`. You'll need to have Go installed. Then you can run directly the generated binary `./bin/binary terraform [command]` to test your changes. + +## Using the plugin from the CLI + +You can also use the plugin with your changes from the CLI by running: `make local` and following the instructions displayed. diff --git a/GNUmakefile b/GNUmakefile deleted file mode 100644 index 7bec63d..0000000 --- a/GNUmakefile +++ /dev/null @@ -1,18 +0,0 @@ -CLI_SOURCE_FILES?=./cmd/plugin -CLI_BINARY_NAME?=binary -CLI_DESTINATION=./bin/$(CLI_BINARY_NAME) - -GOLANGCI_VERSION=v1.63.4 # Also update golangci-lint GH action in code-health.yml when updating this version - -.PHONY: build -build: - @echo "==> Building plugin binary: $(CLI_BINARY_NAME)" - go build -o $(CLI_DESTINATION) $(CLI_SOURCE_FILES) - -.PHONY: tools -tools: - @echo "==> Installing dev tools..." - go telemetry off # disable sending telemetry data, more info: https://go.dev/doc/telemetry - go install github.com/rhysd/actionlint/cmd/actionlint@latest - go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..71ca92e --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +CLI_SOURCE_FILES?=./cmd/plugin +CLI_BINARY_NAME?=binary +CLI_DESTINATION=./bin/$(CLI_BINARY_NAME) +MANIFEST_FILE?=./bin/manifest.yml +WIN_MANIFEST_FILE?=./bin/manifest.windows.yml + +GOLANGCI_VERSION=v1.63.4 # Also update golangci-lint GH action in code-health.yml when updating this version + +.PHONY: build +build: ## Generate the binary in ./bin + @echo "==> Building plugin binary: $(CLI_BINARY_NAME)" + go build -o $(CLI_DESTINATION) $(CLI_SOURCE_FILES) + +.PHONY: tools +tools: ## Install the dev tools (dependencies) + @echo "==> Installing dev tools..." + go telemetry off # disable sending telemetry data, more info: https://go.dev/doc/telemetry + go install github.com/rhysd/actionlint/cmd/actionlint@latest + go install golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment@latest + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin $(GOLANGCI_VERSION) + +.PHONY: clean +clean: ## Clean binary folders + rm -rf ./bin ./bin-plugin + +.PHONY: local +local: clean build ## Allow to run the plugin locally + @echo "==> Configuring plugin locally" + VERSION=0.0.1-local GITHUB_REPOSITORY_OWNER=owner GITHUB_REPOSITORY_NAME=repo $(MAKE) generate-manifest + @mkdir -p ./bin-plugin + cp -r ./bin ./bin-plugin/atlas-cli-plugin-terraform + @echo + @echo "==> Plugin is ready to be used locally" + @echo "run: export ATLAS_CLI_EXTRA_PLUGIN_DIRECTORY=./bin-plugin" + @echo "then this command should show the plugin: atlas plugin list" + +.PHONY: generate-all-manifests +generate-all-manifests: generate-manifest generate-manifest-windows ## Generate all the manifest files + +.PHONY: generate-manifest +generate-manifest: ## Generate the manifest file for non-windows OSes + @echo "==> Generating non-windows manifest file" + @mkdir -p ./bin + BINARY=$(CLI_BINARY_NAME) envsubst < manifest.template.yml > $(MANIFEST_FILE) + +.PHONY: generate-manifest-windows +generate-manifest-windows: ## Generate the manifest file for windows OSes + @echo "==> Generating windows manifest file" + CLI_BINARY_NAME="${CLI_BINARY_NAME}.exe" MANIFEST_FILE="$(WIN_MANIFEST_FILE)" $(MAKE) generate-manifest + +.PHONY: help +.DEFAULT_GOAL := help +help: + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + diff --git a/cmd/plugin/main.go b/cmd/plugin/main.go index 7463d0c..048d0a7 100644 --- a/cmd/plugin/main.go +++ b/cmd/plugin/main.go @@ -11,7 +11,7 @@ import ( func main() { terraformCmd := &cobra.Command{ Use: "terraform", - Short: "Root command of the Atlas CLI plugin for Terraform's MongoDB Atlas Provider", + Short: "Utilities for Terraform's MongoDB Atlas Provider", Aliases: []string{"tf"}, } diff --git a/manifest.template.yml b/manifest.template.yml new file mode 100644 index 0000000..5406fb9 --- /dev/null +++ b/manifest.template.yml @@ -0,0 +1,12 @@ +name: atlas-cli-plugin-terraform +description: Utilities for Terraform's MongoDB Atlas Provider +version: $VERSION +github: + owner: $GITHUB_REPOSITORY_OWNER + name: $GITHUB_REPOSITORY_NAME +binary: $BINARY +commands: + terraform: + description: Utilities for Terraform's MongoDB Atlas Provider + tf: + description: Alias for the terraform command From 29462a9f17d7697d862aef57b0cdb6b793fc8cac Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:37:34 +0100 Subject: [PATCH 08/17] release initial commit --- .github/workflows/release.yml | 39 +++++++++++++++++++++++++++++++++-- .goreleaser.yaml | 14 +++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .goreleaser.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dd9b682..129b3e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,46 @@ name: 'New Release' +run-name: 'Release ${{ inputs.version_number }}' on: workflow_dispatch: + inputs: + version_number: + description: 'Version number (e.g. v1.0.0, v1.0.0-pre, v1.0.0-pre1)' + required: true jobs: - release: + + validate-inputs: runs-on: ubuntu-latest permissions: {} steps: - - run: echo "WIP - Placeholder for release GHA" + - name: Validation of version format + run: echo "${{ inputs.version_number }}" | grep -P '^v\d+\.\d+\.\d+(-pre[A-Za-z0-9-]*)?$' + + create-tag: + needs: validate-inputs + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - run: echo "WIP - Placeholder for create tag" + + release: + needs: create-tag + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a + with: + go-version-file: 'go.mod' + - name: Generate manifest files + env: + GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} + GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }} + VERSION: ${{ inputs.version_number }} + run: make generate-all-manifests + - name: Run GoReleaser + run: echo "WIP - Placeholder for release" diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..a24099e --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,14 @@ +# yaml-language-server: $schema=https://goreleaser.com/static/schema.json +project_name: atlas-cli-plugin-terraform + +version: 2 + +builds: + - id: "atlas-cli-plugin-terraform" + main: ./cmd/plugin/main.go + binary: ./binary + +archives: + - files: + - src: './manifest{{ if eq .Os "windows" }}.windows{{end}}.yml' + dst: ./manifest.yml From ec30261c4d7ddae92ea8fe30b1e9c5ca3b244954 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Sat, 11 Jan 2025 12:44:20 +0100 Subject: [PATCH 09/17] unify GHA names --- .github/workflows/issues.yml | 3 +-- .github/workflows/pull-request-lint.yml | 2 +- .github/workflows/stale.yml | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index d04d0c9..e8a5ca7 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -1,7 +1,6 @@ --- - name: Create JIRA ticket for new issues + name: JIRA Tickets for GH Issues - # Creates and updates jira tickets that sync with GitHub Issues events. on: issues: types: [opened, reopened, closed] diff --git a/.github/workflows/pull-request-lint.yml b/.github/workflows/pull-request-lint.yml index 3b45b59..ab2c34b 100644 --- a/.github/workflows/pull-request-lint.yml +++ b/.github/workflows/pull-request-lint.yml @@ -1,4 +1,4 @@ -name: pull-request-lint +name: PR Linters # Run validations over pull request titles while also adding appropriate labels. on: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index d6e4cb9..a14b41a 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,7 +1,6 @@ --- -name: 'Stale issues and PRs handler' +name: 'Stale PRs & Issues' -# Handles stale github issues and pull requests. on: workflow_dispatch: schedule: From 0e0d334f099c02d8e44667e461fe1048ba5cac1c Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Sat, 11 Jan 2025 14:26:36 +0100 Subject: [PATCH 10/17] enable release --- .github/workflows/release.yml | 20 ++++++++++++++------ .goreleaser.yaml | 5 ++++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 129b3e9..2229829 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,10 +22,15 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - steps: + steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - run: echo "WIP - Placeholder for create tag" - + - name: Create release tag + uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 + with: + tag: ${{ inputs.version_number }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.PASSPHRASE }} + release: needs: create-tag runs-on: ubuntu-latest @@ -33,9 +38,8 @@ jobs: contents: write steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a with: - go-version-file: 'go.mod' + ref: ${{ inputs.version_number }} - name: Generate manifest files env: GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} @@ -43,4 +47,8 @@ jobs: VERSION: ${{ inputs.version_number }} run: make generate-all-manifests - name: Run GoReleaser - run: echo "WIP - Placeholder for release" + uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf + with: + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index a24099e..d1829af 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -10,5 +10,8 @@ builds: archives: - files: - - src: './manifest{{ if eq .Os "windows" }}.windows{{end}}.yml' + - src: './bin/manifest{{ if eq .Os "windows" }}.windows{{end}}.yml' dst: ./manifest.yml + +release: + prerelease: auto From 501fceb5cd2004992a09ed22bcd2b9d00debd67f Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Sat, 11 Jan 2025 18:04:09 +0100 Subject: [PATCH 11/17] fetch-depth: 0 --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2229829..56b3367 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,6 +40,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: ref: ${{ inputs.version_number }} + fetch-depth: 0 - name: Generate manifest files env: GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }} From 4c33e17eeaa78fab4dc335987e510559e12f755b Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:18:04 +0100 Subject: [PATCH 12/17] import gpg key --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 56b3367..520d0ad 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,6 +24,8 @@ jobs: contents: write steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 + - name: Import GPG key + run: echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import - name: Create release tag uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 with: From 8764e634fa3a6f42bf8c7d11dca31efef4c3c865 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:28:38 +0100 Subject: [PATCH 13/17] use master for release --- .github/workflows/release.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 520d0ad..23a403c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,14 +24,16 @@ jobs: contents: write steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - - name: Import GPG key - run: echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import + with: + ref: 'master' + - name: Get the latest commit SHA + id: get-sha + run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" - name: Create release tag uses: rickstaa/action-create-tag@a1c7777fcb2fee4f19b0f283ba888afa11678b72 with: tag: ${{ inputs.version_number }} - gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} - gpg_passphrase: ${{ secrets.PASSPHRASE }} + commit_sha: ${{ steps.get-sha.outputs.sha }} release: needs: create-tag From cec28f076aa65a20b6f12eedf3ef416a64fccfaf Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:34:23 +0100 Subject: [PATCH 14/17] typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 23a403c..a502092 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 with: - ref: 'master' + ref: 'main' - name: Get the latest commit SHA id: get-sha run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" From 8a38100f67ee6e17a99241dacbf91bc5b4dfacf7 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:38:07 +0100 Subject: [PATCH 15/17] don't fix main --- .github/workflows/release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a502092..00b7b45 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,8 +24,6 @@ jobs: contents: write steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - with: - ref: 'main' - name: Get the latest commit SHA id: get-sha run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" From 48a88d1e528349cf84b90083266d1eefc99ce4c8 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Mon, 13 Jan 2025 12:48:29 +0100 Subject: [PATCH 16/17] sign tag --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00b7b45..b705a61 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,8 @@ jobs: with: tag: ${{ inputs.version_number }} commit_sha: ${{ steps.get-sha.outputs.sha }} + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + gpg_passphrase: ${{ secrets.PASSPHRASE }} release: needs: create-tag From 89ae61bc7235314cfa41bf0cdc30cfbe3e285544 Mon Sep 17 00:00:00 2001 From: Leo Antoli <430982+lantoli@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:01:08 +0100 Subject: [PATCH 17/17] sort help --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 71ca92e..a21a543 100644 --- a/Makefile +++ b/Makefile @@ -51,5 +51,5 @@ generate-manifest-windows: ## Generate the manifest file for windows OSes .PHONY: help .DEFAULT_GOAL := help help: - @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' + @grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | sort