From 8797d3ae25b83bba42df6b32255b37c754e37826 Mon Sep 17 00:00:00 2001 From: filipecosta90 Date: Fri, 23 Sep 2022 14:45:03 +0100 Subject: [PATCH] Improved/Secured release process. Using GH links to access the prebuilt binaries --- .github/workflows/publish.yml | 35 ++++++++++--------- .gitignore | 3 +- README.md | 65 +++++++++++++++++++++++++---------- 3 files changed, 66 insertions(+), 37 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6f6826b..35b3197 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,25 +1,26 @@ -name: Publish binaries to GH +# .github/workflows/github-release-publish.yml +name: Publish artifacts to github release on: release: - types: [ published ] + types: [published] jobs: - publish: + releases-matrix: + name: Release Go Binary runs-on: ubuntu-latest + strategy: + matrix: + goos: [linux, darwin,windows] + goarch: [amd64, arm64] steps: - - uses: actions/checkout@master + - uses: actions/checkout@v3 + - uses: wangyoucao577/go-release-action@v1.28 with: - fetch-depth: 1 - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.16.x - - name: Make Release - run: make release - - name: Upload release binaries - uses: alexellis/upload-assets@0.3.0 - env: - GITHUB_TOKEN: ${{ github.token }} - with: - asset_paths: '["./dist/redis-benchmark-go_*"]' + github_token: ${{ secrets.GITHUB_TOKEN }} + goos: ${{ matrix.goos }} + goarch: ${{ matrix.goarch }} + binary_name: "./redis-benchmark-go" + sha256sum: true + asset_name: redis-benchmark-go-${{ matrix.goos }}-${{ matrix.goarch }} + build_command: "make" diff --git a/.gitignore b/.gitignore index b8e8e46..d7f7b8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea coverage.txt redis-benchmark-go -dist \ No newline at end of file +dist +*.json diff --git a/README.md b/README.md index 32de19c..c507cc5 100644 --- a/README.md +++ b/README.md @@ -2,37 +2,64 @@ ## Overview -This repo contains code to mimic redis-benchmark capabilities in go solely for OSS redis cluster. +This repo contains code to mimic redis-benchmark capabilities in go. -## Standalone binaries ( no Golang needed ) +## Getting Started + +### Download Standalone binaries ( no Golang needed ) If you don't have go on your machine and just want to use the produced binaries you can download the following prebuilt bins: -| OS | Arch | Link | -| :--- | :---: | ---: | -| Windows | amd64 (64-bit X86) | [redis-benchmark-go_windows_amd64.exe](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-benchmark-go/redis-benchmark-go_windows_amd64.exe) | -| Linux | amd64 (64-bit X86) | [redis-benchmark-go_linux_amd64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-benchmark-go/redis-benchmark-go_linux_amd64) | -| Linux | arm64 (64-bit ARM) | [redis-benchmark-go_linux_arm64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-benchmark-go/redis-benchmark-go_linux_arm64) | -| Linux | arm (32-bit ARM) | [redis-benchmark-go_linux_arm](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-benchmark-go/redis-benchmark-go_linux_arm) | -| Darwin | amd64 (64-bit X86) | [redis-benchmark-go_darwin_amd64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-benchmark-go/redis-benchmark-go_darwin_amd64) | -| Darwin | arm64 (64-bit ARM) | [redis-benchmark-go_darwin_arm64](https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-benchmark-go/redis-benchmark-go_darwin_arm64) | +https://github.com/filipecosta90/redis-benchmark-go/releases/latest +Here's how: +**Linux** -Here's an example on how to use the above links: -```bash -# Fetch this repo -wget https://s3.amazonaws.com/benchmarks.redislabs/tools/redis-benchmark-go/redis-benchmark-go_linux_amd64 +x86 +``` +wget -c https://github.com/filipecosta90/redis-benchmark-go/releases/latest/download/redis-benchmark-go-linux-amd64.tar.gz -O - | tar -xz + +# give it a try +./redis-benchmark-go --help +``` + +arm64 +``` +wget -c https://github.com/filipecosta90/redis-benchmark-go/releases/latest/download/redis-benchmark-go-linux-arm64.tar.gz -O - | tar -xz + +# give it a try +./redis-benchmark-go --help +``` -# change permissions -chmod 755 redis-benchmark-go_linux_amd64 +**OSX** + +x86 +``` +wget -c https://github.com/filipecosta90/redis-benchmark-go/releases/latest/download/redis-benchmark-go-darwin-amd64.tar.gz -O - | tar -xz + +# give it a try +./redis-benchmark-go --help +``` + +arm64 +``` +wget -c https://github.com/filipecosta90/redis-benchmark-go/releases/latest/download/redis-benchmark-go-darwin-arm64.tar.gz -O - | tar -xz + +# give it a try +./redis-benchmark-go --help +``` + +**Windows** +``` +wget -c https://github.com/filipecosta90/redis-benchmark-go/releases/latest/download/redis-benchmark-go-windows-amd64.tar.gz -O - | tar -xz -# give it a try -./redis-benchmark-go_linux_amd64 --help +# give it a try +./redis-benchmark-go --help ``` -## Installation in a Golang env +### Installation in a Golang env The easiest way to get and install the benchmark utility with a Go Env is to use `go get` and then `go install`: