Skip to content

Commit

Permalink
chore: change version (#82)
Browse files Browse the repository at this point in the history
* chore: change version

* chore: change gitignore

* chore: add .github stuff
  • Loading branch information
geffersonFerraz authored Jan 23, 2025
1 parent e73321d commit f95d336
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 28 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @MagaluCloud/terraform-cli-devs
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## What does this PR do?
<!-- Provide a clear and concise description of the changes -->
<!--Example: This PR adds a new endpoint to the API that allows users to retrieve their order history. It includes the necessary changes to the controller, service, and repository layers, as well as updates to the API documentation. -->

## How Has This Been Tested?
<!-- Please describe the tests you ran to verify your changes and how you tested them. Include any relevant details and evidence. -->
- **Unit Tests**: Describe the unit tests you have written and their outcomes.
<!-- Example: Added unit tests for the new order history endpoint. All tests passed successfully. -->

- **Integration Tests**: Detail the integration tests performed and their results.
<!-- Example: Performed integration tests with the payment service to ensure end-to-end functionality. All tests passed. -->

- **Manual Testing**: Explain the manual testing process, including steps taken and evidence such as screenshots or logs.
<!-- Example: Manually tested the new endpoint using Postman. Verified that the correct order history is returned for different users. Attached screenshots of the Postman results. -->

## Checklist
- [ ] I have run Pre commit `pre-commit run --all-files`
- [ ] My code follows the style guidelines of this project
- [ ] I have made corresponding changes to the documentation
- [ ] I have added tests that prove my fix is effective or that my feature works

## Screenshots/Videos
<!-- If applicable, add screenshots or videos to help explain your changes -->
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ terraform.tfstate
terraform.tfstate.backup
terraform.tfstate.d
**/__debug_bin**
terraform-provider-mgc
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ module github.com/MagaluCloud/terraform-provider-mgc
go 1.23.0

require (
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250122134916-5757410498e5
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250122134916-5757410498e5
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250123132421-2991a186969d
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250123132421-2991a186969d
github.com/hashicorp/terraform-plugin-framework v1.11.0
github.com/hashicorp/terraform-plugin-framework-validators v0.13.0
github.com/hashicorp/terraform-plugin-log v0.9.0
)

require (
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250122134916-5757410498e5 // indirect
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250123132421-2991a186969d // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/geffersonFerraz/brazilian-words-sorter v1.1.0 // indirect
github.com/getkin/kin-openapi v0.118.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ atomicgo.dev/keyboard v0.2.9 h1:tOsIid3nlPLZ3lwgG8KZMp/SFmr7P0ssEN5JUsm78K8=
atomicgo.dev/keyboard v0.2.9/go.mod h1:BC4w9g00XkxH/f1HXhW2sXmJFOCWbKn9xrOunSFtExQ=
atomicgo.dev/schedule v0.1.0 h1:nTthAbhZS5YZmgYbb2+DH8uQIZcTlIrd4eYr3UQxEjs=
atomicgo.dev/schedule v0.1.0/go.mod h1:xeUa3oAkiuHYh8bKiQBRojqAMq3PXXbJujjb0hw8pEU=
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250122134916-5757410498e5 h1:OIu6Ji2nCiYZeVAIFeW6Xx1x9J3hK+9Uq/trFGsv6IY=
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250122134916-5757410498e5/go.mod h1:h0UDw9so9zAtRrh82BB9CiR7bKwhJ/osSmbSwZWYX8I=
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250122134916-5757410498e5 h1:pAOmHdlNvO+P/PWuGZuxMCiDBgQ6aAB2rHB87u34/dA=
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250122134916-5757410498e5/go.mod h1:6ZrWG4JZNTU+0bW6VZnMAd1teKf4ggnDLxBaHb5QxzY=
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250122134916-5757410498e5 h1:8gFv20lRlSUpK1UCosn+WZOiNk2kgwY0O148hBhjTdM=
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250122134916-5757410498e5/go.mod h1:XHyD9dr46r6oQxPq5dUV6pQYxaLvioTaxka7yUhB9Ms=
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250123132421-2991a186969d h1:JvOaCHsyhWFmHpqW9b5C1iSDx/uplXGG4bNgGQnmy+s=
github.com/MagaluCloud/magalu/mgc/core v0.0.0-20250123132421-2991a186969d/go.mod h1:h0UDw9so9zAtRrh82BB9CiR7bKwhJ/osSmbSwZWYX8I=
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250123132421-2991a186969d h1:TEHM4frHlV/UaicuI90+W9Mm69MC59rj0xnMbDuaFSQ=
github.com/MagaluCloud/magalu/mgc/lib v0.0.0-20250123132421-2991a186969d/go.mod h1:6ZrWG4JZNTU+0bW6VZnMAd1teKf4ggnDLxBaHb5QxzY=
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250123132421-2991a186969d h1:adl+0gUxEFHDMuHGFE5pEWb1Ks0rSb61OmkgSCfUd5I=
github.com/MagaluCloud/magalu/mgc/sdk v0.0.0-20250123132421-2991a186969d/go.mod h1:XHyD9dr46r6oQxPq5dUV6pQYxaLvioTaxka7yUhB9Ms=
github.com/MarvinJWendt/testza v0.1.0/go.mod h1:7AxNvlfeHP7Z/hDQ5JtE3OKYT3XFUeLCDE2DQninSqs=
github.com/MarvinJWendt/testza v0.2.1/go.mod h1:God7bhG8n6uQxwdScay+gjm9/LnO4D3kkcZX4hv9Rp8=
github.com/MarvinJWendt/testza v0.2.8/go.mod h1:nwIcjmr0Zz+Rcwfh3/4UhBp7ePKVhuBExvZqnKYWlII=
Expand Down
10 changes: 5 additions & 5 deletions goreleaser_terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ builds:
- arm64
binary: terraform-provider-mgc
ldflags:
- -s -w -X github.com/MagaluCloud/magalu/sdk.Version={{.Version}}"
- -s -w -X main.Version={{.Version}}"
flags:
- -tags=embed release
main: main.go
Expand All @@ -25,7 +25,7 @@ builds:
- arm64
binary: terraform-provider-mgc
ldflags:
- -s -w -X github.com/MagaluCloud/magalu/sdk.Version={{.Version}}"
- -s -w -X main.Version={{.Version}}"
flags:
- -tags=embed release
main: main.go
Expand Down Expand Up @@ -53,8 +53,8 @@ archives:
checksum:
extra_files:
- glob: "terraform-registry-manifest.json"
name_template: "terraform-provider-{{ .ProjectName }}_{{ .Version }}_manifest.json"
name_template: "terraform-provider-{{ .ProjectName }}_{{ .Version }}_SHA256SUMS"
name_template: "terraform-provider-mgc_{{ .Version }}_manifest.json"
name_template: "terraform-provider-mgc_{{ .Version }}_SHA256SUMS"
algorithm: sha256
signs:
- artifacts: checksum
Expand All @@ -74,7 +74,7 @@ signs:
release:
extra_files:
- glob: "terraform-registry-manifest.json"
name_template: "terraform-provider-{{ .ProjectName }}_{{ .Version }}_manifest.json"
name_template: "terraform-provider-mgc_{{ .Version }}_manifest.json"
draft: true
prerelease: true
header: |
Expand Down
10 changes: 2 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@ import (
"github.com/hashicorp/terraform-plugin-framework/providerserver"
)

var (
// these will be set by the goreleaser configuration
// to appropriate values for the compiled binary.
version string = "dev"
commit string = "none"
date string = "unknown"
)
var Version string = "dev"

func main() {
var debug bool
Expand All @@ -28,7 +22,7 @@ func main() {
Debug: debug,
}

err := providerserver.Serve(context.Background(), mgc.New(version, commit, date), opts)
err := providerserver.Serve(context.Background(), mgc.New(Version), opts)

if err != nil {
log.Fatal(err.Error())
Expand Down
8 changes: 2 additions & 6 deletions mgc/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ const providerTypeName = "mgc"

type mgcProvider struct {
version string
commit string
date string
sdk *mgcSdk.Sdk
}

Expand Down Expand Up @@ -187,16 +185,14 @@ func (p *mgcProvider) DataSources(ctx context.Context) []func() datasource.DataS
}
}

func New(version string, commit string, date string) func() provider.Provider {
func New(version string) func() provider.Provider {
sdk := mgcSdk.NewSdk()
mgcSdk.SetUserAgent("MgcTF")
mgcSdk.SetUserAgent("MgcTF/" + version)

return func() provider.Provider {
return &mgcProvider{
sdk: sdk,
version: version,
commit: commit,
date: date,
}
}
}
Binary file removed terraform-provider-mgc
Binary file not shown.

0 comments on commit f95d336

Please sign in to comment.