Skip to content

Commit d89f019

Browse files
Karl Sorensenninjasftw
authored andcommitted
renamed project, added docs, added workflow
1 parent d8322dc commit d89f019

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1107
-131
lines changed

.github/workflows/release.yml

Lines changed: 24 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,41 @@
1+
# Terraform Provider release workflow.
12
name: Release
23

4+
# This GitHub action creates a release when a tag that matches the pattern
5+
# "v*" (e.g. v0.1.0) is created.
36
on:
47
push:
58
tags:
69
- 'v*'
710

11+
# Releases need permissions to read and write the repository contents.
12+
# GitHub considers creating releases and uploading assets as writing contents.
813
permissions:
914
contents: write
1015

1116
jobs:
12-
build:
13-
name: Build
17+
goreleaser:
1418
runs-on: ubuntu-latest
15-
strategy:
16-
matrix:
17-
include:
18-
- goos: linux
19-
goarch: amd64
20-
- goos: linux
21-
goarch: arm64
22-
- goos: darwin
23-
goarch: amd64
24-
- goos: darwin
25-
goarch: arm64
26-
- goos: windows
27-
goarch: amd64
28-
2919
steps:
30-
- name: Checkout code
31-
uses: actions/checkout@v4
32-
33-
- name: Set up Go
34-
uses: actions/setup-go@v5
20+
- uses: actions/checkout@v4
3521
with:
36-
go-version: '1.23'
37-
38-
- name: Get version from tag
39-
id: version
40-
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
41-
42-
- name: Build binary
43-
env:
44-
GOOS: ${{ matrix.goos }}
45-
GOARCH: ${{ matrix.goarch }}
46-
run: |
47-
BINARY_NAME="terraform-provider-axonops_v${{ steps.version.outputs.VERSION }}_${{ matrix.goos }}_${{ matrix.goarch }}"
48-
if [ "${{ matrix.goos }}" = "windows" ]; then
49-
BINARY_NAME="${BINARY_NAME}.exe"
50-
fi
51-
go build -o "${BINARY_NAME}" -ldflags="-s -w"
52-
zip "${BINARY_NAME}.zip" "${BINARY_NAME}"
53-
54-
- name: Upload artifact
55-
uses: actions/upload-artifact@v4
22+
# Allow goreleaser to access older tag information.
23+
fetch-depth: 0
24+
- uses: actions/setup-go@v5
5625
with:
57-
name: terraform-provider-axonops_${{ matrix.goos }}_${{ matrix.goarch }}
58-
path: "*.zip"
59-
60-
release:
61-
name: Create Release
62-
needs: build
63-
runs-on: ubuntu-latest
64-
steps:
65-
- name: Checkout code
66-
uses: actions/checkout@v4
67-
68-
- name: Download all artifacts
69-
uses: actions/download-artifact@v4
26+
go-version-file: 'go.mod'
27+
cache: true
28+
- name: Import GPG key
29+
uses: crazy-max/ghaction-import-gpg@v6
30+
id: import_gpg
7031
with:
71-
path: artifacts
72-
merge-multiple: true
73-
74-
- name: Generate checksums
75-
run: |
76-
cd artifacts
77-
sha256sum *.zip > checksums.txt
78-
79-
- name: Create Release
80-
uses: softprops/action-gh-release@v1
32+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
33+
passphrase: ${{ secrets.PASSPHRASE }}
34+
- name: Run GoReleaser
35+
uses: goreleaser/goreleaser-action@v6
8136
with:
82-
files: |
83-
artifacts/*.zip
84-
artifacts/checksums.txt
85-
generate_release_notes: true
86-
draft: false
87-
prerelease: false
37+
args: release --clean
38+
env:
39+
# GitHub sets the GITHUB_TOKEN secret automatically.
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.goreleaser.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Visit https://goreleaser.com for documentation on how to customize this
2+
# behavior.
3+
version: 2
4+
before:
5+
hooks:
6+
- go mod tidy
7+
builds:
8+
- env:
9+
- CGO_ENABLED=0
10+
mod_timestamp: '{{ .CommitTimestamp }}'
11+
flags:
12+
- -trimpath
13+
ldflags:
14+
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
15+
goos:
16+
- freebsd
17+
- windows
18+
- linux
19+
- darwin
20+
goarch:
21+
- amd64
22+
- '386'
23+
- arm
24+
- arm64
25+
ignore:
26+
- goos: darwin
27+
goarch: '386'
28+
- goos: windows
29+
goarch: arm
30+
binary: '{{ .ProjectName }}_v{{ .Version }}'
31+
archives:
32+
- formats:
33+
- zip
34+
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
35+
checksum:
36+
extra_files:
37+
- glob: 'terraform-registry-manifest.json'
38+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
39+
name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
40+
algorithm: sha256
41+
signs:
42+
- artifacts: checksum
43+
args:
44+
- "--batch"
45+
- "--local-user"
46+
- "{{ .Env.GPG_FINGERPRINT }}"
47+
- "--output"
48+
- "${signature}"
49+
- "--detach-sign"
50+
- "${artifact}"
51+
release:
52+
extra_files:
53+
- glob: 'terraform-registry-manifest.json'
54+
name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json'
55+
changelog:
56+
disable: true

axonops-kafka-tf

-21.6 MB
Binary file not shown.

data_source_cassandra_adaptive_repair.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
axonopsClient "axonops-tf/client"
7+
axonopsClient "terraform-provider-axonops/client"
88

99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"

data_source_cassandra_backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
axonopsClient "axonops-tf/client"
7+
axonopsClient "terraform-provider-axonops/client"
88

99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"

data_source_healthcheck_http.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
axonopsClient "axonops-tf/client"
7+
axonopsClient "terraform-provider-axonops/client"
88

99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"

data_source_healthcheck_shell.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
axonopsClient "axonops-tf/client"
7+
axonopsClient "terraform-provider-axonops/client"
88

99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"

data_source_healthcheck_tcp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
axonopsClient "axonops-tf/client"
7+
axonopsClient "terraform-provider-axonops/client"
88

99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"

data_source_kafka_acl.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
axonopsClient "axonops-tf/client"
7+
axonopsClient "terraform-provider-axonops/client"
88

99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"
@@ -93,7 +93,7 @@ func (d *aclDataSource) Schema(ctx context.Context, req datasource.SchemaRequest
9393

9494
type aclDataSourceData struct {
9595
ClusterName types.String `tfsdk:"cluster_name"`
96-
ACLs []aclEntry `tfsdk:"acls"`
96+
ACLs []aclEntry `tfsdk:"acls"`
9797
}
9898

9999
type aclEntry struct {

data_source_kafka_connect_connector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
axonopsClient "axonops-tf/client"
7+
axonopsClient "terraform-provider-axonops/client"
88

99
"github.com/hashicorp/terraform-plugin-framework/datasource"
1010
"github.com/hashicorp/terraform-plugin-framework/datasource/schema"

0 commit comments

Comments
 (0)