File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5959 echo "Timed out waiting for CI to complete."
6060 exit 1
6161
62- release :
62+ goreleaser :
6363 runs-on : ubuntu-latest
6464 needs : wait_ci
6565 steps :
@@ -68,33 +68,18 @@ jobs:
6868 fetch-depth : 0
6969 - uses : actions/setup-go@v5
7070 with :
71- go-version : ' 1.22'
72- - name : Import GPG private key (for checksum signing)
73- env :
74- GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
75- GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
76- run : |
77- if [ -z "${GPG_PRIVATE_KEY:-}" ]; then
78- echo "No GPG_PRIVATE_KEY secret set; skipping key import."
79- exit 0
80- fi
81- mkdir -p ~/.gnupg
82- chmod 700 ~/.gnupg
83- echo "Importing GPG key"
84- echo "$GPG_PRIVATE_KEY" | gpg --batch --import
85- if [ -n "${GPG_PASSPHRASE:-}" ]; then
86- echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
87- echo 'allow-loopback-pinentry' >> ~/.gnupg/gpg-agent.conf
88- gpg-connect-agent reloadagent /bye
89- fi
90- gpg --list-secret-keys --keyid-format LONG || true
91- - name : Build
92- run : go build ./...
93- - name : GoReleaser
71+ go-version-file : ' go.mod'
72+ cache : true
73+ - name : Import GPG key
74+ id : import_gpg
75+ uses : crazy-max/ghaction-import-gpg@v6
76+ with :
77+ gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
78+ passphrase : ${{ secrets.PASSPHRASE }}
79+ - name : Run GoReleaser
9480 uses : goreleaser/goreleaser-action@v5
9581 with :
96- version : latest
9782 args : release --clean
9883 env :
9984 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
100- GPG_TTY : ${{ runner.env.SSH_AUTH_SOCK }}
85+ GPG_FINGERPRINT : ${{ steps.import_gpg.outputs.fingerprint }}
Original file line number Diff line number Diff line change 1+ version : 2
12project_name : terraform-provider-logstruct
23before :
34 hooks :
45 - go mod tidy
56builds :
67 - id : provider
78 main : ./main.go
8- # Binary inside the ZIP must be versioned for Terraform Registry ingestion
9- binary : terraform-provider-logstruct_v{{ .Version }}
109 env :
1110 - CGO_ENABLED=0
12- goos : [linux, darwin, windows]
13- goarch : [amd64, arm64]
14- flags : ["- trimpath"]
11+ mod_timestamp : ' {{ .CommitTimestamp }} '
12+ flags :
13+ - - trimpath
1514 ldflags :
16- - -s -w -X main.version={{.Version}}
15+ - ' -s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
16+ goos :
17+ - freebsd
18+ - windows
19+ - linux
20+ - darwin
21+ goarch :
22+ - amd64
23+ - ' 386'
24+ - arm
25+ - arm64
26+ ignore :
27+ - goos : darwin
28+ goarch : ' 386'
29+ # Binary inside ZIP must be versioned: terraform-provider-<name>_v<version>
30+ binary : ' {{ .ProjectName }}_v{{ .Version }}'
1731archives :
18- - id : archive
19- name_template : ' {{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}'
20- builds : [provider]
21- format : zip
32+ - format : zip
33+ name_template : ' {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}'
2234checksum :
23- name_template : ' {{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
35+ extra_files :
36+ - glob : ' terraform-registry-manifest.json'
37+ name_template : ' {{ .ProjectName }}_{{ .Version }}_manifest.json'
38+ name_template : ' {{ .ProjectName }}_{{ .Version }}_SHA256SUMS'
39+ algorithm : sha256
2440signs :
2541 - artifacts : checksum
42+ args :
43+ - " --batch"
44+ - " --local-user"
45+ - " {{ .Env.GPG_FINGERPRINT }}"
46+ - " --output"
47+ - " ${signature}"
48+ - " --detach-sign"
49+ - " ${artifact}"
2650release :
27- draft : false
28- prerelease : auto
29- name_template : ' v{{ .Version }}'
51+ extra_files :
52+ - glob : ' terraform-registry-manifest.json'
53+ name_template : ' {{ .ProjectName }}_{{ .Version }}_manifest.json'
54+ # draft: true # uncomment if you want to inspect before publishing
55+ changelog :
56+ disable : true
Original file line number Diff line number Diff line change 1+ {
2+ "version" : 1 ,
3+ "metadata" : {
4+ "protocol_versions" : [" 6.0" ]
5+ }
6+ }
7+
You can’t perform that action at this time.
0 commit comments