Skip to content

Commit

Permalink
Adding makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
deven96 committed Nov 1, 2022
1 parent 7a908d2 commit 8453011
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,15 @@ prep-ci-local-windows:
cp ".\scripts\config.local.yaml" ".\config-test.yaml"
cat config-test.yaml

ifneq($(findstring fake, $(version)), fake)
upgrade:
@echo ">>> Recreating version_num.go"
@echo 'package cmd\n\nconst Version = "$(version)"' > cmd/version_num.go
@go run main.go version
@git tag v$(version)
@echo ">>> Pushing Tag to Remote..."
@git push origin v$(version)
else
upgrade:
@echo "Version not set - use syntax \`make upgrade version=0.x.x\`"
endif
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,52 @@ saido means monitor in Hausa

NOTE: `!windows` flag is our current specification of what `unix` means, seee [issue](https://github.com/golang/go/issues/20322) for why *_unix.go files will still attempt to run on windows


## Installation

### Usage

For personal usage, install latest from [Github Releases](https://github.com/bisohns/saido/releases)

```bash
# binary is downloaded and named as saido
saido api
```


### Development

With Golang installed, run

```bash
git clone https://github.com/bisohns/saido
cd saido
## Update Golang dependencies
go get .

## Update yarn dependencies
cd web
yarn install

# Run websocket server and serve frontend
go run main.go api
```

## Deployment

### Tagging

To create a new tag, use the make file

```bash
make upgrade version=0.x.x
```
This will tag a new version, push to github and trigger goreleaser

## License

The project is opened under the [Apache License](https://github.com/bisohns/saido/blob/master/LICENSE)

### Credits
- Logo by [Williams Praise](https://github.com/kubyruby)
- Goph by [Melbahja](https://github.com/melbahja/goph)
20 changes: 20 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

var versionCmd = &cobra.Command{
Use: "version",
Short: "Get saido version",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("version %s", Version)
},
}

func init() {
rootCmd.AddCommand(versionCmd)
}
4 changes: 4 additions & 0 deletions cmd/version_num.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package cmd

// Version: current version string
const Version = ""

0 comments on commit 8453011

Please sign in to comment.