Skip to content

Commit 3da749d

Browse files
authored
Merge pull request #29 from robmorgan/feat/goreleaser
Use GoReleaser to Handle Releases
2 parents 369a4c2 + 9ac55ac commit 3da749d

File tree

10 files changed

+392
-437
lines changed

10 files changed

+392
-437
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: infraspec snapshot build
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
name: Create binary releases
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
24+
- name: Import GPG key
25+
id: import_gpg
26+
uses: crazy-max/[email protected]
27+
with:
28+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
29+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
30+
31+
- name: Release dry run
32+
uses: goreleaser/goreleaser-action@v6
33+
with:
34+
distribution: goreleaser
35+
version: "~> v2"
36+
args: release --snapshot --clean
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: infraspec release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
name: Create binary releases
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
24+
- name: Import GPG key
25+
id: import_gpg
26+
uses: crazy-max/[email protected]
27+
with:
28+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
29+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
30+
31+
- name: Release
32+
uses: goreleaser/goreleaser-action@v6
33+
with:
34+
distribution: goreleaser
35+
version: "~> v2"
36+
args: release --clean
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
#SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/bin
2+
/dist
23
/infraspec
34

45
# misc

.goreleaser.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
project_name: infraspec
2+
3+
version: 2
4+
5+
release:
6+
github:
7+
owner: robmorgan
8+
name: infraspec
9+
draft: false
10+
prerelease: false
11+
12+
builds:
13+
- id: infraspec
14+
main: ./cmd/infraspec/main.go
15+
binary: infraspec
16+
goos:
17+
- linux
18+
- darwin
19+
- windows
20+
goarch:
21+
- amd64
22+
- arm64
23+
ldflags:
24+
- -s -w -X github.com/robmorgan/infraspec/internal/build.Version={{.Version}}
25+
- -X github.com/robmorgan/infraspec/internal/build.Commit={{.Commit}}
26+
- -X github.com/robmorgan/infraspec/internal/build.Date={{.Date}}
27+
env:
28+
- CGO_ENABLED=0
29+
30+
notarize:
31+
macos:
32+
- enabled: '{{ isEnvSet "MACOS_SIGN_P12" }}'
33+
sign:
34+
certificate: "{{.Env.MACOS_SIGN_P12}}"
35+
password: "{{.Env.MACOS_SIGN_PASSWORD}}"
36+
#entitlements: ./resources/entitlements.mac.plist
37+
notarize:
38+
issuer_id: "{{.Env.MACOS_NOTARY_ISSUER_ID}}"
39+
key_id: "{{.Env.MACOS_NOTARY_KEY_ID}}"
40+
key: "{{.Env.MACOS_NOTARY_KEY}}"
41+
wait: true
42+
timeout: 30m
43+
44+
archives:
45+
- id: archive
46+
ids:
47+
- infraspec
48+
files:
49+
- LICENSE
50+
- README.md
51+
name_template: >-
52+
{{ .ProjectName }}-webapp-{{- .Os }}-{{ .Arch }}
53+
formats: ["tar.gz"]
54+
format_overrides:
55+
- goos: windows
56+
formats:
57+
- zip
58+
59+
checksum:
60+
name_template: "checksums.txt"
61+
62+
changelog:
63+
use: github
64+
65+
homebrew_casks:
66+
- name: infraspec
67+
ids:
68+
- archive
69+
binary: infraspec
70+
url:
71+
template: "https://github.com/robmorgan/infraspec/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
72+
verified: "github.com/robmorgan/infraspec/"
73+
using: ":homebrew_curl"
74+
cookies:
75+
license: "accept-backup"
76+
referer: "https://infraspec.sh/download/"
77+
headers:
78+
- "X-Version: {{ .Version }}"
79+
user_agent: "InfraSpec/{{ .Version }} ({{ .Os }}/{{ .Arch }})"
80+
commit_author:
81+
name: goreleaserbot
82+
83+
commit_msg_template: "Brew cask update for {{ .ProjectName }} version {{ .Tag }}"
84+
directory: Casks
85+
caveats: "How to use this binary"
86+
homepage: "https://infraspec.sh/"
87+
description: "Test your cloud infrastructure in plain English, no code required."
88+
skip_upload: true
89+
repository:
90+
owner: robmorgan
91+
name: homebrew-infraspec
92+
branch: main
93+
#token: "{{ .Env.GITHUB_PERSONAL_AUTH_TOKEN }}"
94+
95+
announce:
96+
slack:
97+
enabled: true
98+
message_template: ":tada: infraspec {{.Tag}} is now available!!!! :tada:"
99+
channel: "#infraspec"
100+
username: "infraspecbot"

.vscode/settings.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,17 @@
1313
"iacprovisioner",
1414
"infratest",
1515
"testhelpers",
16+
"retryable",
1617
"rollouts",
1718

1819
// Brightfame
1920
"InfraSpec",
2021
"robmorgan",
2122

23+
// Go Dependencies
24+
"lipgloss",
25+
"goreleaser",
26+
2227
// Cucumber
2328
"godog"
2429
]

0 commit comments

Comments
 (0)