File tree 4 files changed +24
-11
lines changed
4 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 32
32
33
33
- name : Build Smithyctl
34
34
run : |
35
- make smithyctl/bin
35
+ make smithyctl/bin SMITHYCTL_VERSION=${{ steps.tag_info.outputs.version }}
36
36
cd bin/smithyctl/cmd/linux/amd64/
37
37
tar --create --file smithyctl-linux-amd64-${{ steps.tag_info.outputs.version }}.tar.gz --verbose --gzip smithyctl
38
38
Original file line number Diff line number Diff line change @@ -173,8 +173,14 @@ $(component_major_tags): check-branch check-tag-message
173
173
smithyctl/bin :
174
174
$(eval GOOS:=linux)
175
175
$(eval GOARCH:=amd64)
176
+ $(eval SMITHYCTL_VERSION:=development)
176
177
@cd smithyctl && \
177
- GOOS=$(GOOS ) GOARCH=$(GOARCH ) go build -o ../bin/smithyctl/cmd/$(GOOS ) /$(GOARCH ) /smithyctl main.go
178
+ GOOS=$(GOOS ) \
179
+ GOARCH=$(GOARCH ) \
180
+ go build \
181
+ -ldflags " -X github.com/smithy-security/smithy/smithyctl/command/version.SmithyCTLVersion=${SMITHYCTL_VERSION} -s -w" \
182
+ -trimpath \
183
+ -o ../bin/smithyctl/cmd/$(GOOS ) /$(GOARCH ) /smithyctl main.go
178
184
179
185
component-sdk-version :
180
186
@if [ -z " $( COMPONENT_DIR) " ]; then \
Original file line number Diff line number Diff line change @@ -23,12 +23,12 @@ smithyctl version
23
23
24
24
## Commands
25
25
26
- | Command | Description | Status |
27
- | -------------| -------------------------------------------------------------| ----------------------- |
28
- | ` help ` | will output how to use ` smithyctl ` | Implemented |
29
- | ` version ` | will output the version of the installed ` smithyctl ` binary | Not implemented yet |
30
- | ` component ` | allows to develop, run and distribute components | Not fully implemented |
31
- | ` workflow ` | allows to develop and run workflows | Implemented |
26
+ | Command | Description |
27
+ | -------------| -------------------------------------------------------------|
28
+ | ` help ` | will output how to use ` smithyctl ` |
29
+ | ` version ` | will output the version of the installed ` smithyctl ` binary |
30
+ | ` component ` | allows to develop, run and distribute components |
31
+ | ` workflow ` | allows to develop and run workflows |
32
32
33
33
### Component
34
34
Original file line number Diff line number Diff line change 1
1
package version
2
2
3
- import "github.com/spf13/cobra"
3
+ import (
4
+ "log"
5
+
6
+ "github.com/spf13/cobra"
7
+ )
8
+
9
+ // SmithyCTLVersion overridable smithyctl version.
10
+ var SmithyCTLVersion = "development"
4
11
5
12
// NewCommand returns a new version command.
6
13
func NewCommand () * cobra.Command {
7
14
return & cobra.Command {
8
15
Use : "version" ,
9
16
Short : "Outputs smithyctl's version" ,
10
- // TODO: implement in https://linear.app/smithy/issue/OCU-481/version-command
11
- RunE : func ( cmd * cobra. Command , args [] string ) error {
17
+ RunE : func ( _ * cobra. Command , _ [] string ) error {
18
+ log . Println ( SmithyCTLVersion )
12
19
return nil
13
20
},
14
21
}
You can’t perform that action at this time.
0 commit comments