1
0
mirror of https://github.com/cmur2/miflorad.git synced 2024-12-21 16:54:24 +01:00

module: add release instructions and script

Using https://github.com/buildkite/github-release
This commit is contained in:
cn 2019-01-25 10:39:09 +01:00
parent 1addfc0bc3
commit 4f265b76a8
3 changed files with 21 additions and 0 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
cmd/miflorad/miflorad
cmd/munin-miflora/munin-miflora
cmd/munin-miflora-gatt/munin-miflora-gatt
pkg/miflorad-*

View File

@ -34,6 +34,13 @@ remote-run: clean
scp cmd/$(RUN_COMMAND)/$(RUN_COMMAND) extzero:$(RUN_COMMAND)
ssh extzero "./$(RUN_COMMAND) $(RUN_OPTIONS)"
.PHONY: release
release:
mkdir -p pkg
cd cmd/miflorad && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o "../../pkg/miflorad-$(MIFLORAD_VERSION)-linux-amd64" -ldflags="-s -w -X main.version=$(MIFLORAD_VERSION)" && cd ../..
cd cmd/miflorad && CGO_ENABLED=0 GOOS=linux GOARCH=arm go build -o "../../pkg/miflorad-$(MIFLORAD_VERSION)-linux-arm" -ldflags="-s -w -X main.version=$(MIFLORAD_VERSION)" && cd ../..
github-release "v$(MIFLORAD_VERSION)" pkg/miflorad-$(MIFLORAD_VERSION)-* --commit "master" --tag "v$(MIFLORAD_VERSION)" --prerelease --github-repository "cmur2/miflorad"
.PHONY: cmd/miflorad/miflorad
cmd/miflorad/miflorad:
cd cmd/miflorad && CGO_ENABLED=0 go build -buildmode=pie -ldflags "-X main.version=$(MIFLORAD_VERSION)" && cd ../..

View File

@ -48,3 +48,16 @@ handle = 0x0040, char properties = 0x02, char value handle = 0x0041, uuid = 0000
- [https://wiki.hackerspace.pl/projects:xiaomi-flora](https://wiki.hackerspace.pl/projects:xiaomi-flora) (very nice teardown)
- [https://github.com/open-homeautomation/miflora](https://github.com/open-homeautomation/miflora) (python library)
## Doing a release
Install the [github-release binary](https://github.com/buildkite/github-release) helper somewhere into your path as `github-release`.
You also need a [personal access token](https://github.com/settings/tokens) for your Github account.
The below will create a Github release of `miflorad` based on your current git working copy and create a matching git tag:
```bash
export GITHUB_RELEASE_ACCESS_TOKEN=my-personal-access-token
MIFLORAD_VERSION=x.y.z make release
```