Skip to content

Commit 6c5264c

Browse files
committed
IND-6310 - CRT Onboarding
1 parent 2fed359 commit 6c5264c

File tree

7 files changed

+342
-0
lines changed

7 files changed

+342
-0
lines changed

.github/workflows/build.yml

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
name: build
2+
3+
# We now default to running this workflow on every push to every branch.
4+
# This provides fast feedback when build issues occur, so they can be
5+
# fixed prior to being merged to the main branch.
6+
#
7+
# If you want to opt out of this, and only run the build on certain branches
8+
# please refer to the documentation on branch filtering here:
9+
#
10+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onpushbranchestagsbranches-ignoretags-ignore
11+
#
12+
on: [workflow_dispatch, push]
13+
14+
env:
15+
PKG_NAME: "go-getter"
16+
17+
jobs:
18+
get-go-version:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
go-version: ${{ steps.get-go-version.outputs.go-version }}
22+
steps:
23+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24+
- name: Determine Go version
25+
id: get-go-version
26+
# We use .go-version as our source of truth for current Go
27+
# version, because "goenv" can react to it automatically.
28+
# Specify the exact Go version (e.g., 1.22.4) in .go-version
29+
# if your build requires a specific patch version of Go.
30+
# Otherwise, specify the major and minor versions (e.g., 1.22),
31+
# with a caveat that it can lead to builds using different
32+
# patch versions of Go in a workflow run.
33+
run: |
34+
echo "Building with Go $(cat .go-version)"
35+
echo "go-version=$(cat .go-version)" >> "$GITHUB_OUTPUT"
36+
37+
set-product-version:
38+
runs-on: ubuntu-latest
39+
outputs:
40+
product-version: ${{ steps.set-product-version.outputs.product-version }}
41+
product-base-version: ${{ steps.set-product-version.outputs.base-product-version }}
42+
product-prerelease-version: ${{ steps.set-product-version.outputs.prerelease-product-version }}
43+
product-minor-version: ${{ steps.set-product-version.outputs.minor-product-version }}
44+
steps:
45+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
46+
- name: Set Product version
47+
id: set-product-version
48+
uses: hashicorp/actions-set-product-version@v1
49+
50+
generate-metadata-file:
51+
needs: set-product-version
52+
runs-on: ubuntu-latest
53+
outputs:
54+
filepath: ${{ steps.generate-metadata-file.outputs.filepath }}
55+
steps:
56+
- name: "Checkout directory"
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58+
- name: Generate metadata file
59+
id: generate-metadata-file
60+
uses: hashicorp/actions-generate-metadata@v1
61+
with:
62+
version: ${{ needs.set-product-version.outputs.product-version }}
63+
product: ${{ env.PKG_NAME }}
64+
repositoryOwner: "hashicorp"
65+
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
66+
with:
67+
name: metadata.json
68+
path: ${{ steps.generate-metadata-file.outputs.filepath }}
69+
70+
build-other:
71+
needs:
72+
- get-go-version
73+
- set-product-version
74+
runs-on: ubuntu-latest
75+
strategy:
76+
fail-fast: false # recommended during development
77+
matrix:
78+
goos: [freebsd, windows, netbsd, openbsd, solaris]
79+
goarch: ["386", "amd64", "arm"]
80+
go: [ "${{ needs.get-go-version.outputs.go-version }}" ]
81+
exclude:
82+
- goos: solaris
83+
goarch: 386
84+
- goos: solaris
85+
goarch: arm
86+
- goos: windows
87+
goarch: arm
88+
89+
name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build
90+
91+
steps:
92+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
93+
94+
- uses: hashicorp/actions-go-build@v1
95+
env:
96+
BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }}
97+
PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}}
98+
METADATA_VERSION: ${{ env.METADATA }}
99+
with:
100+
product_name: ${{ env.PKG_NAME }}
101+
product_version: ${{ needs.set-product-version.outputs.product-version }}
102+
go_version: ${{ matrix.go }}
103+
os: ${{ matrix.goos }}
104+
arch: ${{ matrix.goarch }}
105+
reproducible: report
106+
instructions: |-
107+
cp LICENSE "$TARGET_DIR/LICENSE.txt"
108+
go build -o "$BIN_PATH" -trimpath -buildvcs=false
109+
110+
build-linux:
111+
needs:
112+
- get-go-version
113+
- set-product-version
114+
runs-on: ubuntu-latest
115+
strategy:
116+
matrix:
117+
goos: [linux]
118+
goarch: ["arm", "arm64", "386", "amd64"]
119+
120+
fail-fast: false # recommended during development
121+
122+
name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build
123+
124+
steps:
125+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
126+
127+
- uses: hashicorp/actions-go-build@v1
128+
env:
129+
BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }}
130+
PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}}
131+
METADATA_VERSION: ${{ env.METADATA }}
132+
with:
133+
product_name: ${{ env.PKG_NAME }}
134+
product_version: ${{ needs.set-product-version.outputs.product-version }}
135+
go_version: ${{ needs.get-go-version.outputs.go-version }}
136+
os: ${{ matrix.goos }}
137+
arch: ${{ matrix.goarch }}
138+
reproducible: report
139+
instructions: |
140+
cp LICENSE "$TARGET_DIR/LICENSE.txt"
141+
go build -o "$BIN_PATH" -trimpath -buildvcs=false
142+
- name: Copy license file to config_dir
143+
if: ${{ matrix.goos == 'linux' }}
144+
env:
145+
LICENSE_DIR: ".release/linux/package/usr/share/doc/${{ env.PKG_NAME }}"
146+
run: |
147+
mkdir -p "$LICENSE_DIR" && cp LICENSE "$LICENSE_DIR/LICENSE.txt"
148+
- name: Package
149+
if: ${{ matrix.goos == 'linux' }}
150+
uses: hashicorp/actions-packaging-linux@v1
151+
with:
152+
name: ${{ github.event.repository.name }}
153+
description: "go-getter is a Go library and command line tool for downloading files and directories from various sources including local filesystems, HTTP(S), Git, Mercurial, Amazon S3, Google Cloud Storage, and Azure Blob Storage."
154+
arch: ${{ matrix.goarch }}
155+
version: ${{ needs.set-product-version.outputs.product-version }}
156+
maintainer: "HashiCorp"
157+
homepage: "https://github.com/hashicorp/go-getter"
158+
license: "MPL-2.0"
159+
binary: "dist/${{ env.PKG_NAME }}"
160+
deb_depends: "openssl"
161+
rpm_depends: "openssl"
162+
config_dir: ".release/linux/package/"
163+
164+
- name: Set Package Names
165+
if: ${{ matrix.goos == 'linux' }}
166+
run: |
167+
echo "RPM_PACKAGE=$(basename out/*.rpm)" >> "$GITHUB_ENV"
168+
echo "DEB_PACKAGE=$(basename out/*.deb)" >> "$GITHUB_ENV"
169+
170+
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
171+
if: ${{ matrix.goos == 'linux' }}
172+
with:
173+
name: ${{ env.RPM_PACKAGE }}
174+
path: out/${{ env.RPM_PACKAGE }}
175+
176+
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
177+
if: ${{ matrix.goos == 'linux' }}
178+
with:
179+
name: ${{ env.DEB_PACKAGE }}
180+
path: out/${{ env.DEB_PACKAGE }}
181+
182+
build-darwin:
183+
needs:
184+
- get-go-version
185+
- set-product-version
186+
runs-on: macos-latest
187+
strategy:
188+
matrix:
189+
goos: [darwin]
190+
goarch: ["amd64", "arm64"]
191+
fail-fast: true
192+
193+
name: Go ${{ needs.get-go-version.outputs.go-version }} ${{ matrix.goos }} ${{ matrix.goarch }} build
194+
195+
env:
196+
GOOS: ${{ matrix.goos }}
197+
GOARCH: ${{ matrix.goarch }}
198+
199+
steps:
200+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
201+
202+
- uses: hashicorp/actions-go-build@v1
203+
env:
204+
BASE_VERSION: ${{ needs.set-product-version.outputs.product-base-version }}
205+
PRERELEASE_VERSION: ${{ needs.set-product-version.outputs.product-prerelease-version}}
206+
METADATA_VERSION: ${{ env.METADATA }}
207+
with:
208+
product_name: ${{ env.PKG_NAME }}
209+
product_version: ${{ needs.set-product-version.outputs.product-version }}
210+
go_version: ${{ needs.get-go-version.outputs.go-version }}
211+
os: ${{ matrix.goos }}
212+
arch: ${{ matrix.goarch }}
213+
reproducible: report
214+
instructions: |
215+
cp LICENSE "$TARGET_DIR/LICENSE.txt"
216+
go build -o "$BIN_PATH" -trimpath -buildvcs=false

.go-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.24.6

.release/ci.hcl

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
schema = "1"
2+
3+
project "go-getter" {
4+
team = "team-ip-compliance"
5+
6+
slack {
7+
notification_channel = "C09KTF77K6X" // ensure this is a PUBLIC slack channel. If it's private, the promotion workflows will fail.
8+
}
9+
10+
github {
11+
organization = "hashicorp"
12+
repository = "go-getter"
13+
release_branches = ["main", "release/**"]
14+
}
15+
}
16+
17+
event "merge" {
18+
}
19+
event "build" {
20+
21+
action "build" {
22+
organization = "hashicorp"
23+
repository = "go-getter"
24+
workflow = "build"
25+
depends = null
26+
config = ""
27+
}
28+
29+
depends = ["merge"]
30+
}
31+
event "prepare" {
32+
33+
action "prepare" {
34+
organization = "hashicorp"
35+
repository = "crt-workflows-common"
36+
workflow = "prepare"
37+
depends = ["build"]
38+
config = ""
39+
}
40+
41+
depends = ["build"]
42+
43+
notification {
44+
on = "fail"
45+
}
46+
}
47+
event "trigger-staging" {
48+
}
49+
event "promote-staging" {
50+
51+
action "promote-staging" {
52+
organization = "hashicorp"
53+
repository = "go-getter"
54+
workflow = "promote-staging"
55+
depends = null
56+
config = "oss-release-metadata.hcl"
57+
}
58+
59+
depends = ["trigger-staging"]
60+
61+
notification {
62+
on = "always"
63+
}
64+
65+
promotion-events {
66+
67+
pre-promotion {
68+
organization = "hashicorp"
69+
repository = "go-getter"
70+
workflow = "enos-run"
71+
}
72+
}
73+
}
74+
event "trigger-production" {
75+
}
76+
event "promote-production" {
77+
78+
action "promote-production" {
79+
organization = "hashicorp"
80+
repository = "crt-workflows-common"
81+
workflow = "promote-production"
82+
depends = null
83+
config = ""
84+
}
85+
86+
depends = ["trigger-production"]
87+
88+
notification {
89+
on = "always"
90+
}
91+
92+
promotion-events {
93+
bump-version-patch = true
94+
update-ironbank = true
95+
}
96+
}

.release/release-metadata.hcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
url_source_repository = "https://github/hashicorp/go-getter"
2+
url_license = "https://github.com/hashicorp/go-getter/blob/main/LICENSE"
3+
url_release_notes = "https://github.com/hashicorp/go-getter/releases"

.release/security-scan.hcl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
container {
2+
dependencies = true
3+
osv = true
4+
secrets = true
5+
6+
}
7+
8+
binary {
9+
secrets = true
10+
go_modules = true
11+
osv = true
12+
oss_index = false
13+
nvd = false
14+
}

version/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.8.5-dev

version/version.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Copyright IBM Corp. 2015, 2025
2+
// SPDX-License-Identifier: MPL-2.0
3+
4+
package version
5+
6+
var (
7+
Version = "1.8.5"
8+
VersionPrerelease = "dev"
9+
VersionMetadata = ""
10+
// PluginVersion removed to avoid import cycle
11+
)

0 commit comments

Comments
 (0)