Browse Source

module: add release instructions and script

Using https://github.com/buildkite/github-release
pull/13/head
cn 1 year ago
parent
commit
4f265b76a8
3 changed files with 21 additions and 0 deletions
  1. +1
    -0
      .gitignore
  2. +7
    -0
      Makefile
  3. +13
    -0
      README.md

+ 1
- 0
.gitignore View File

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

+ 7
- 0
Makefile 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 ../..


+ 13
- 0
README.md 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
```

Loading…
Cancel
Save