Skip to content

Commit d5279ef

Browse files
Onboarding consul-dataplane to VBA (version bump automation) as per - https://hashicorp.atlassian.net/wiki/spaces/RELENG/pages/2484306717/How+To+Onboard+Version+Bump+Automation
1 parent f2cabae commit d5279ef

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ jobs:
3838
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
3939
- name: get product version
4040
id: get-product-version
41-
run: |
42-
make version
43-
echo "product-version=$(make version)" >> $GITHUB_OUTPUT
41+
uses: hashicorp/actions-set-product-version@v1
4442

4543
generate-metadata-file:
4644
needs: get-product-version
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: create a release branch
2+
on: [workflow_dispatch]
3+
jobs:
4+
create-branch:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
8+
- uses: hashicorp/actions-create-release-branch@v1
9+
with:
10+
token: ${{ secrets.ELEVATED_GITHUB_TOKEN }}

.release/ci.hcl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,12 @@ event "promote-production-packaging" {
124124
on = "always"
125125
}
126126
}
127+
128+
event "bump-version" {
129+
depends = ["promote-production-packaging"]
130+
action "bump-version" {
131+
organization = "hashicorp"
132+
repository = "crt-workflows-common"
133+
workflow = "bump-version"
134+
}
135+
}

cmd/consul-dataplane/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ import (
77
"context"
88
"flag"
99
"fmt"
10+
"github.com/hashicorp/consul-dataplane/version"
1011
"log"
1112
"os"
1213
"os/signal"
1314
"strings"
1415
"syscall"
1516

1617
"github.com/hashicorp/consul-dataplane/pkg/consuldp"
17-
"github.com/hashicorp/consul-dataplane/pkg/version"
1818
)
1919

2020
var (

version/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.1.6-dev
File renamed without changes.
File renamed without changes.

pkg/version/version.go renamed to version/version.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
// Copyright (c) HashiCorp, Inc.
2-
// SPDX-License-Identifier: MPL-2.0
3-
41
package version
52

63
import (
4+
_ "embed"
75
"fmt"
86
"strings"
97
)
@@ -14,15 +12,15 @@ var (
1412
GitCommit string
1513

1614
// The main version number that is being run at the moment.
17-
//
1815
// Version must conform to the format expected by github.com/hashicorp/go-version
1916
// for tests to work.
20-
Version = "1.3.0"
21-
22-
// A pre-release marker for the version. If this is "" (empty string)
17+
// VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
2318
// then it means that it is a final release. Otherwise, this is a pre-release
2419
// such as "dev" (in development), "beta", "rc1", etc.
25-
VersionPrerelease = "dev"
20+
// Version and VersionPrerelease info are now being embedded directly from the VERSION file.
21+
//go:embed VERSION
22+
fullVersion string
23+
Version, VersionPrerelease, _ = strings.Cut(strings.TrimSpace(fullVersion), "-")
2624
)
2725

2826
// GetHumanVersion composes the parts of the version in a way that's suitable

0 commit comments

Comments
 (0)