forked from tsenart/vegeta
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
all: Fix build, upgrade deps and automate release (tsenart#626)
- Loading branch information
Showing
16 changed files
with
305 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,134 @@ | ||
on: [push, pull_request] | ||
name: CI | ||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Release version' | ||
required: true | ||
|
||
jobs: | ||
ci: | ||
strategy: | ||
matrix: | ||
go-version: [1.13.x] | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
qa: | ||
name: Quality Assurance | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v1 | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Vet | ||
run: go vet ./... | ||
|
||
- name: Test | ||
run: go test -race -v ./... | ||
run: go test -race ./... | ||
|
||
build: | ||
name: Build | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: ['windows', 'linux', 'darwin'] | ||
goarch: ['amd64', 'arm64'] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Build | ||
env: | ||
GOOS: ${{ matrix.goos }} | ||
GOARCH: ${{ matrix.goarch }} | ||
run: | | ||
set -euo pipefail | ||
make vegeta | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
NAME="vegeta_${VERSION}_${GOOS}_${GOARCH}" | ||
if [[ "$GOOS" != "windows" ]]; then | ||
tar -czf "$NAME.tar.gz" vegeta | ||
else | ||
zip "$NAME.zip" vegeta.exe | ||
fi | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: vegeta_${{ matrix.goos }}_${{ matrix.goarch }} | ||
path: | | ||
*.zip | ||
*.tar.gz | ||
release: | ||
name: Release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: [qa, build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download Artifacts | ||
uses: actions/download-artifact@v3 | ||
|
||
- name: Create checksums and sign them | ||
id: sign | ||
run: | | ||
set -euo pipefail | ||
mkdir dist | ||
mv vegeta*/* dist/ | ||
cd dist | ||
VERSION=${GITHUB_REF#refs/tags/v} | ||
CHECKSUMS=vegeta_${VERSION}_checksums.txt | ||
sha256sum * > $CHECKSUMS | ||
echo "${{ secrets.VEGETA_GPG_KEY }}" | gpg --batch --yes --pinentry-mode loopback --import | ||
gpg --detach-sign -a $CHECKSUMS | ||
echo "name=${VERSION}" >> $GITHUB_OUTPUT | ||
- name: Generate release notes | ||
id: release_notes | ||
run: | | ||
set -x | ||
set -euo pipefail | ||
CURRENT_VERSION=${GITHUB_REF#refs/tags/} | ||
PREV_VERSION=$(git describe --tags --abbrev=0 $CURRENT_VERSION^) | ||
RELEASE_NOTES=${{ github.workspace }}/release-notes.txt | ||
echo "## Changelog\n" > $RELEASE_NOTES | ||
git log ${PREV_VERSION}..${CURRENT_VERSION} --oneline --abbrev-commit >> $RELEASE_NOTES | ||
cat $RELEASE_NOTES | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
name: ${{ steps.sign.outputs.version }} | ||
body_path: ${{ github.workspace }}/release-notes.txt | ||
files: | | ||
dist/* | ||
tag_name: ${{ steps.sign.outputs.version }} | ||
draft: true | ||
prerelease: false | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,36 @@ | ||
module github.com/tsenart/vegeta/v12 | ||
|
||
go 1.13 | ||
go 1.20 | ||
|
||
require ( | ||
github.com/alecthomas/jsonschema v0.0.0-20180308105923-f2c93856175a | ||
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b | ||
github.com/bmizerany/perks v0.0.0-20141205001514-d9a9656a3a4b | ||
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae | ||
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b | ||
github.com/dgryski/go-gk v0.0.0-20140819190930-201884a44051 | ||
github.com/dgryski/go-lttb v0.0.0-20180810165845-318fcdf10a77 | ||
github.com/google/go-cmp v0.5.9 | ||
github.com/influxdata/tdigest v0.0.1 | ||
github.com/mailru/easyjson v0.7.7 | ||
github.com/miekg/dns v1.1.17 | ||
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d | ||
github.com/tsenart/go-tsz v0.0.0-20180814235614-0bd30b3df1c3 | ||
golang.org/x/net v0.12.0 | ||
pgregory.net/rapid v0.3.3 | ||
) | ||
|
||
require ( | ||
github.com/gonum/blas v0.0.0-20181208220705-f22b278b28ac // indirect | ||
github.com/gonum/diff v0.0.0-20181124234638-500114f11e71 // indirect | ||
github.com/gonum/floats v0.0.0-20181209220543-c233463c7e82 // indirect | ||
github.com/gonum/integrate v0.0.0-20181209220457-a422b5c0fdf2 // indirect | ||
github.com/gonum/internal v0.0.0-20181124074243-f884aa714029 // indirect | ||
github.com/gonum/lapack v0.0.0-20181123203213-e4cdc5a0bff9 // indirect | ||
github.com/gonum/mathext v0.0.0-20181121095525-8a4bf007ea55 // indirect | ||
github.com/gonum/matrix v0.0.0-20181209220409-c518dec07be9 // indirect | ||
github.com/gonum/stat v0.0.0-20181125101827-41a0da705a5b // indirect | ||
github.com/google/go-cmp v0.2.0 | ||
github.com/influxdata/tdigest v0.0.0-20180711151920-a7d76c6f093a | ||
github.com/mailru/easyjson v0.7.0 | ||
github.com/miekg/dns v1.1.17 | ||
github.com/streadway/quantile v0.0.0-20220407130108-4246515d968d | ||
github.com/tsenart/go-tsz v0.0.0-20180814232043-cdeb9e1e981e | ||
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 | ||
pgregory.net/rapid v0.3.3 | ||
github.com/iancoleman/orderedmap v0.3.0 // indirect | ||
github.com/josharian/intern v1.0.0 // indirect | ||
github.com/shurcooL/httpfs v0.0.0-20230704072500-f1e31cf0ba5c // indirect | ||
github.com/shurcooL/vfsgen v0.0.0-20230704071429-0000e147ea92 // indirect | ||
golang.org/x/crypto v0.11.0 // indirect | ||
golang.org/x/sys v0.10.0 // indirect | ||
golang.org/x/text v0.11.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.