Skip to content

Commit

Permalink
Merge branch 'master' of http://github.com/tsenart/vegeta into issue/#…
Browse files Browse the repository at this point in the history
…477-promlib

Fixing small typos
  • Loading branch information
flaviostutz committed Jul 22, 2023
2 parents a4f7d77 + 73d929f commit 3a8efbf
Show file tree
Hide file tree
Showing 47 changed files with 1,043 additions and 650 deletions.
54 changes: 0 additions & 54 deletions .chglog/CHANGELOG.tpl.md

This file was deleted.

26 changes: 0 additions & 26 deletions .chglog/config.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .deepsource.toml

This file was deleted.

11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "gomod"
directory: "/"
schedule:
interval: "weekly"
161 changes: 161 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
name: CI
on:
push:
tags:
- 'v*.*.*'
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true

jobs:
qa:
name: Quality Assurance
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Format Check
run: |
set -euo pipefail
go install golang.org/x/tools/cmd/goimports@latest
goimports -w .
git diff --exit-code
- name: Vet
run: go vet ./...

- name: Test
run: go test -race ./...

build:
name: Build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
strategy:
matrix:
target:
- 'windows/amd64'
- 'windows/386'
- 'windows/arm64'
- 'linux/amd64'
- 'linux/386'
- 'linux/arm64'
- 'linux/arm'
- 'darwin/amd64'
- 'darwin/arm64'
- 'freebsd/386'
- 'freebsd/amd64'
- 'freebsd/arm'
- 'openbsd/amd64'
- 'openbsd/arm64'
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'

- name: Set up GOOS and GOARCH
id: setup_env
run: |
echo "goos=$(echo ${{ matrix.target }} | cut -d'/' -f1)" >> $GITHUB_OUTPUT
echo "goarch=$(echo ${{ matrix.target }} | cut -d'/' -f2)" >> $GITHUB_OUTPUT
- name: Build
env:
GOOS: ${{ steps.setup_env.outputs.goos }}
GOARCH: ${{ steps.setup_env.outputs.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_${{ steps.setup_env.outputs.goos }}_${{ steps.setup_env.outputs.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 --export --armor > vegeta_${VERSION}_pubkey.asc
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
printf "## Changelog\n\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 }}
35 changes: 0 additions & 35 deletions .goreleaser.yml

This file was deleted.

22 changes: 0 additions & 22 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2016 Tomás Senart
Copyright (c) 2013-2023 Tomás Senart

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
25 changes: 7 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,14 @@ COMMIT=$(shell git rev-parse HEAD)
VERSION=$(shell git describe --tags --exact-match --always)
DATE=$(shell date +'%FT%TZ%z')

vegeta: vendor generate
vegeta: generate
CGO_ENABLED=0 go build -v -a -tags=netgo \
-ldflags '-s -w -extldflags "-static" -X main.Version=$(VERSION) -X main.Commit=$(COMMIT) -X main.Date=$(DATE)'

clean-vegeta:
rm vegeta

generate: vendor
go get -u github.com/mailru/easyjson/...
generate: GOARCH := $(shell go env GOHOSTARCH)
generate: GOOS := $(shell go env GOHOSTOS)
generate:
go install github.com/mailru/easyjson/...@latest
go get github.com/shurcooL/vfsgen
go install github.com/shurcooL/vfsgen/...@latest
go generate ./...

vendor:
go mod vendor

clean-vendor:
rm -rf vendor

dist:
goreleaser release --debug --skip-validate

clean-dist:
rm -rf dist
Loading

0 comments on commit 3a8efbf

Please sign in to comment.