diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..013c2e7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: release +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 1 + - name: Setup Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..ac5aa31 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,34 @@ +project_name: tmplscript +env: + - GO111MODULE=on +before: + hooks: + - go mod tidy +builds: + - main: . + binary: tmplscript + ldflags: + - -s -w + - -X main.Version={{.Version}} + - -X main.Revision={{.ShortCommit}} + env: + - CGO_ENABLED=0 + goos: + - freebsd + - windows + - linux + goarch: + - 386 + - amd64 + - arm + - arm64 +archives: + - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}' + replacements: + darwin: darwin + linux: linux + windows: windows + 386: i386 + amd64: x86_64 +release: + prerelease: auto diff --git a/README.md b/README.md index 9a0285b..309360a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,16 @@ executable go-template command (like awk and jq!) +# install + +Get binary [here](https://github.com/Syuparn/tmplscript/releases). + +You can also install from `go get`. + +```bash +$ go get -u github.com/syuparn/tmplscript +``` + # usage ```bash