Skip to content

Commit

Permalink
Merge pull request #10 from mroth/cleanup
Browse files Browse the repository at this point in the history
Cleanup: five year maintenance
  • Loading branch information
mroth authored Jul 21, 2020
2 parents 86d3f13 + 95a33b6 commit 3214445
Show file tree
Hide file tree
Showing 78 changed files with 788 additions and 7,907 deletions.
1 change: 0 additions & 1 deletion .github/FUNDING.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: goreleaser

on:
push:
tags:
- "v*"

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go: ["1.14"]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Cache modules
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run tests
run: go test -race ./...
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
bin
.tokens
builds
dist
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
before:
hooks:
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- darwin
- windows
goarch:
- amd64
main: ./cmd/slacknimate
archives:
- format_overrides:
- goos: windows
format: zip
checksum:
name_template: "checksums.txt"
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
skip: true
20 changes: 0 additions & 20 deletions Godeps/Godeps.json

This file was deleted.

5 changes: 0 additions & 5 deletions Godeps/Readme

This file was deleted.

26 changes: 7 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,31 +1,19 @@
.PHONY: build_deps build goinstall gouninstall package_deps package clobber
.PHONY: build_deps build package_deps package clobber
.DEFAULT_GOAL := build

build_deps:
@type go >/dev/null 2>&1 || \
{ echo >&2 "I require go but it is not installed. Aborting."; exit 1; }

build: build_deps
go build -o bin/slacknimate
go build -o bin/slacknimate ./cmd/slacknimate


# Standard go install, for people with a valid go / $GOPATH setup
goinstall:
go install .

gouninstall:
rm $(GOPATH)/bin/slacknimate


# For cross compiling and packaging releases
package_deps:
go get github.com/laher/goxc

package: package_deps build
goxc -pv=`./bin/slacknimate -v | cut -d' ' -f3` \
--resources-include="README*,LICENSE*,examples" \
-d="builds" -bc="linux,!arm darwin windows" xc archive rmbin
@type goreleaser >/dev/null 2>&1 || \
{ echo >&2 "I require goreleaser but it is not installed. Aborting."; exit 1; }

package: package_deps
goreleaser release --rm-dist --skip-publish

clobber:
rm -rf builds bin
rm -rf dist bin
66 changes: 33 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,40 @@
# slacknimate
> text animation for Slack messages :dancers:
> Realtime text animation for Slack messages :dancers:
Useful for ChatOps:
![deployinator](https://cloud.githubusercontent.com/assets/40650/26273321/0cd49fda-3cfc-11e7-90ce-78f369e783ac.gif)
## Primary use case: ChatOps

![deployinator-example](https://cloud.githubusercontent.com/assets/40650/26273321/0cd49fda-3cfc-11e7-90ce-78f369e783ac.gif)

## Alternative uses

...Or for comedy:
While slacknimate is primarily intended for ChatOps, it has become popular
for... other use cases.

![slacknimate_fine2](https://cloud.githubusercontent.com/assets/40650/26273332/613cc17e-3cfc-11e7-9365-88b0043c17ef.gif)
...Such as comedy:

![thisisfine-example](https://cloud.githubusercontent.com/assets/40650/26273332/613cc17e-3cfc-11e7-9365-88b0043c17ef.gif)

...Or maybe art:

![slacknimate_nyan](https://cloud.githubusercontent.com/assets/40650/26273350/ad3b0d56-3cfc-11e7-9359-83c92f440a03.gif)
![nyancat-example](https://cloud.githubusercontent.com/assets/40650/26273350/ad3b0d56-3cfc-11e7-9359-83c92f440a03.gif)


## Installation
Download a binary from the [Releases Page](https://github.com/mroth/slacknimate/releases) and put it somewhere on your `$PATH`.

_macOS Homebrew users, you can also just `brew install slacknimate`._
Simply download a binary for your OS/architecture from the [Releases
Page](https://github.com/mroth/slacknimate/releases) and put it somewhere on
your `$PATH`.

_Homebrew users, you can also just `brew install slacknimate`._

## Authentication
Generate your Slack user token on [this page][1].

Generate your Slack app and generate an API token. Note that the app will need
appropriate OAuth scopes to post messages to your desired destination.

You'll need to either pass it to the program via the `--api-token` flag or store
it as `SLACK_TOKEN` environment variable.

_If you want the message to come from a bot name/icon instead, see "Bots"
section at the bottom of this README._

[1]: https://api.slack.com/docs/oauth-test-tokens

## Usage

```
Expand All @@ -41,28 +45,31 @@ USAGE:
slacknimate [options]
VERSION:
1.0.0
COMMANDS:
help, h Shows a list of commands or help for one command
1.1.0-development
GLOBAL OPTIONS:
--api-token, -a API token* [$SLACK_TOKEN]
--delay, -d "1" minimum delay between frames
--channel, -c channel/destination* [$SLACK_CHANNEL]
--loop, -l loop content upon reaching end
--preview preview on terminal instead of posting
--help, -h show help
--version, -v print the version
--token value, -a value Slack API token* [$SLACK_TOKEN]
--channel value, -c value Slack channel* [$SLACK_CHANNEL]
--username value Slack username [$SLACK_USERNAME]
--icon-url value Slack icon from url [$SLACK_ICON_URL]
--icon-emoji value Slack icon from emoji [$SLACK_ICON_EMOJI]
--delay value, -d value minimum delay between frames (default: 1)
--loop, -l loop content upon reaching EOF (default: false)
--preview preview on terminal only (default: false)
--help, -h show help (default: false)
--version, -v print the version (default: false)
```

You can also use Slacknimate directly via the [Go package](https://godoc.org/github.com/mroth/slacknimate).

### Simple animation loops

$ slacknimate -c "#general" --loop < examples/emoji.txt

![slacknimate1](https://cloud.githubusercontent.com/assets/40650/13275355/32f5997c-da82-11e5-8a9d-61c53f94c718.gif)

### Realtime process monitoring

Why spam a chatroom with periodic monitoring messages when you can have realtime
status updates so that a message is never out of date?

Expand All @@ -84,17 +91,10 @@ Done!


### Preview in terminal

If you aren't certain about your source, you can preview what the animation
would look like in the terminal via the `--preview` flag.

$ slacknimate --preview --loop -d 0.25 < examples/sample.txt

![slacknimate3](https://cloud.githubusercontent.com/assets/40650/13275357/3b04b6ac-da82-11e5-9fab-1a7704c98b12.gif)

## Bots
In order for Slack message editing to work, the message _must_ be posted
`as_user: true`, which will show as coming from whomever owns the token. This
is due to how the security model for Slack message editing works.

For bots, you must create a new bot in the team settings and substitute in the
auth token for that bot.
Loading

0 comments on commit 3214445

Please sign in to comment.