Skip to content

Commit

Permalink
Merge pull request #9 from wide-vsix/action-init
Browse files Browse the repository at this point in the history
Action init
  • Loading branch information
slankdev authored Oct 22, 2022
2 parents c65f390 + 3a04c38 commit 2b9f79a
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: latest origin/main

on:
push:
branches:
- "main"

jobs:
build:
name: Publish for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: flowctl
asset_name: flowctl.linux-amd64
steps:
- name: set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
id: go
- name: checkout
uses: actions/checkout@v2
- name: download modules
if: steps.cache.outputs.cache-hit != 'true'
run: go mod download
- name: test
run: go test ./... -v
- name: build
run: go build -o ${{ matrix.artifact_name }} cmd/flowctl/main.go
- name: upload
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}
overwrite: true
12 changes: 12 additions & 0 deletions pkg/flowctl/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func NewCommand() *cobra.Command {
cmd.AddCommand(NewCommandMeter())
cmd.AddCommand(NewCommandDependencyCheck())
cmd.AddCommand(NewCommandEbpf())
cmd.AddCommand(NewCommandVersion())
cmd.AddCommand(util.NewCmdCompletion(cmd))
return cmd
}
Expand Down Expand Up @@ -422,3 +423,14 @@ func getTcEbpfByteCode(netns, dev string) (string, error) {
}
return "", nil
}

func NewCommandVersion() *cobra.Command {
cmd := &cobra.Command{
Use: "version",
RunE: func(cmd *cobra.Command, args []string) error {
fmt.Printf("v0.0.0\n")
return nil
},
}
return cmd
}

0 comments on commit 2b9f79a

Please sign in to comment.