Skip to content

Commit 00822b8

Browse files
committed
Added Makefile to build releases
1 parent a4cd119 commit 00822b8

3 files changed

Lines changed: 25 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
/bin
12
main

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# credit: https://vic.demuzere.be/articles/golang-makefile-crosscompile/
2+
PLATFORMS := darwin/386 darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64
3+
4+
checkenv:
5+
ifndef TAG
6+
$(error release TAG is required - e.g v0.1.0)
7+
endif
8+
9+
temp = $(subst /, ,$@)
10+
os = $(word 1, $(temp))
11+
arch = $(word 2, $(temp))
12+
name = slack-multi-channel-invite
13+
longname = $(name)-$(TAG)-$(os)-$(arch)
14+
15+
release: $(PLATFORMS)
16+
17+
$(PLATFORMS): checkenv
18+
GOOS=$(os) GOARCH=$(arch) go build -o 'bin/$(longname)/$(name)' main.go
19+
cd bin/$(longname) && zip $(longname).zip $(name)
20+
21+
.PHONY: checkenv release $(PLATFORMS) zip

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ Enjoy!
1313
- `channels.read`
1414
- `channels.write`
1515
3. Install app to your workspace which will generate a new OAuth Access Token
16-
4. Install this script via `go get github.com/jamietsao/slack-multi-channel-invite`
16+
4. Download script:
17+
- If you have Go installed: `go get github.com/jamietsao/slack-multi-channel-invite`
18+
- Else download the binary directly: https://github.com/jamietsao/slack-multi-channel-invite/releases
1719
5. Run script:
1820

1921
`slack-multi-channel-invite -api_token=<oauth-access-token> -channels=foo,bar,baz -user_email=steph@curry.com`

0 commit comments

Comments
 (0)