diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a26c151..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,43 +0,0 @@ -version: 2.1 - -defaults: &defaults - working_directory: /go/src/github.com/interchainio/tm-load-test - docker: - - image: circleci/golang - -jobs: - release: - <<: *defaults - steps: - - checkout - - attach_workspace: - at: /go/src/github.com/interchainio/tm-load-test/build - - run: - name: Release - command: | - /bin/bash .circleci/release.bash - -workflows: - version: 2 - - mini_qa: - jobs: - - lint - - test - - build - release_management: - jobs: - - build: - filters: - branches: - ignore: /.*/ - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+/ - - release: - requires: - - build - filters: - branches: - ignore: /.*/ - tags: - only: /^v[0-9]+\.[0-9]+\.[0-9]+/ diff --git a/.circleci/release.bash b/.circleci/release.bash deleted file mode 100644 index 666d85a..0000000 --- a/.circleci/release.bash +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -set -euo pipefail -# Opinionated script to release on GitHub. -# This script runs in CircleCI, in a golang docker container from a folder that is a git repo. -# The script was triggered because of a git tag push. CIRCLE_TAG contains the tag pushed. -# The script expects the binaries to reside in the build folder. -STOML_VERSION=0.3.0 - -# Create GitHub release draft -draftdata=" -{ - \"tag_name\": \"${CIRCLE_TAG}\", - \"target_commitish\": \"${CIRCLE_BRANCH}\", - \"name\": \"${CIRCLE_TAG}\", - \"body\": \"${CIRCLE_TAG} release.\", - \"draft\": true, - \"prerelease\": false -} -" -curl -s -S -X POST -u "${GITHUB_USERNAME}:${GITHUB_TOKEN}" https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases --user-agent releasebot -H "Accept: application/vnd.github.v3.json" -d "$draftdata" > draft.json -ERR=$? -if [[ $ERR -ne 0 ]]; then - echo "ERROR: curl error, exitcode $ERR." - exit $ERR -fi - -wget -q "https://github.com/freshautomations/stoml/releases/download/v${STOML_VERSION}/stoml_linux_amd64" -chmod +x ./stoml_linux_amd64 -export id="`./stoml_linux_amd64 draft.json id`" -if [ -z "$id" ]; then - echo "ERROR: Could not get draft id." - exit 1 -fi - -echo "Release ID: ${id}" - -# Upload binaries - -for binary in tm-load-test -do -echo -ne "Processing ${binary}... " -if [[ ! -f "build/${binary}" ]]; then - echo "${binary} does not exist." - continue -fi -curl -s -S -X POST -u "${GITHUB_USERNAME}:${GITHUB_TOKEN}" "https://uploads.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases/${id}/assets?name=${binary}" --user-agent releasebot -H "Accept: application/vnd.github.v3.raw+json" -H "Content-Type: application/octet-stream" -H "Content-Encoding: utf8" --data-binary "@build/${binary}" > upload.json -ERR=$? -if [[ $ERR -ne 0 ]]; then - echo "ERROR: curl error, exitcode $ERR." - exit $ERR -fi - -export uid="`./stoml_linux_amd64 upload.json id`" -if [ -z "$uid" ]; then - echo "ERROR: Could not get upload id for binary ${binary}." - exit 1 -fi - -echo "uploaded binary ${binary}, id ${uid}." -done - -rm draft.json -rm upload.json - -# Publish release -releasedata=" -{ - \"draft\": false, - \"tag_name\": \"${CIRCLE_TAG}\" -} -" -curl -s -S -X POST -u "${GITHUB_USERNAME}:${GITHUB_TOKEN}" "https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/releases/${id}" --user-agent script -H "Accept: application/vnd.github.v3.json" -d "$releasedata" -ERR=$? -if [[ $ERR -ne 0 ]]; then - echo "ERROR: curl error, exitcode $ERR." - exit $ERR -fi - diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..06946ec --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + time: "11:00" + open-pull-requests-limit: 10 + labels: + - T:dependencies + - package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + time: "11:00" + open-pull-requests-limit: 10 + labels: + - T:dependencies diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0cc474f..1bd218e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,9 +14,9 @@ jobs: timeout-minutes: 4 steps: - uses: actions/checkout@v2 - - uses: golangci/golangci-lint-action@master + - uses: golangci/golangci-lint-action@v2 with: # Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version. - version: v1.28 + version: v1.30 args: --timeout 10m github-token: ${{ secrets.github_token }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a9e2ab9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,27 @@ +name: "Release" + +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - 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..9ebf2ce --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,20 @@ +project_name: tm-load-test + +env: + # Require use of Go modules. + - GO111MODULE=on + +checksum: + name_template: SHA256SUMS-{{.Version}}.txt + algorithm: sha256 + +release: + name_template: "{{.Version}}" + +archives: + files: + - LICENSE + - README.md + - UPGRADING.md + - SECURITY.md + - CHANGELOG.md