diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000000000000000000000000000000000000..11d418806ff2cc5d23b7a945d498d8f799a31b42 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,39 @@ +name: Go-CI +on: + push: + branches: [ master ] + tags: [ '**' ] + pull_request: + branches: [ master ] + workflow_dispatch: +jobs: + lint: + name: lint + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: golangci-lint + uses: golangci/golangci-lint-action@v2 + build: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.16 + - name: Build + run: go build -v ./... + release: + runs-on: ubuntu-20.04 + needs: [ lint, build ] + if: ${{ startsWith(github.ref, 'refs/tags/') && contains(fromJSON('["mxschmitt", "JonasProgrammer"]'), github.actor) }} + steps: + - uses: actions/checkout@v2 + - 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 0000000000000000000000000000000000000000..18c01d8d80627e91b63842eb011845edc3b27acd --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,9 @@ +builds: + - goos: + - darwin + - linux + - windows + goarch: + - amd64 + env: + - CGO_ENABLED=0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d0b4fefa2ce827705051dec719434032b0442179..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Builds the docker-machine-driver-hetzner and releases it, if the build is a tag -# (due to the deploy.on.tags=true below). -# -# To make it work, create and encrypt an OAuth token for the Github API as follows: -# (1) Go to https://github.com/settings/tokens and create a new private token -# with scope "public_repo". -# (2) Convert the token into a Travis secret as described at -# https://docs.travis-ci.com/user/encryption-keys/: -# * (assuming you are on a shell with the current working directory being -# inside a local working copy of your Github project) -# * gem install travis -# * travis encypt <the token created in step (1)> -# * add the secure: "<encrypted token>" to the travis.yml file as a key -# below the api_key -language: go -go: - - stable -env: - global: - - GO111MODULE=on - - CGO_ENABLED=0 - -before_deploy: - # Create binaries for many OSs and architures as tarballs. - # the -osarch="!a/b !c/d" option is used to exclude OS-arch pairs - # a/b and c/d from the build. OS-arch pairs might e.g. be excluded - # they failed to build. - - go get github.com/mitchellh/gox - - mkdir releases - - gox -osarch='!netbsd/arm !openbsd/386 !openbsd/amd64 !netbsd/386 !netbsd/amd64 !darwin/386' -output="releases/{{.Dir}}_`git describe --tags --abbrev=0`_{{.OS}}_{{.Arch}}/{{.Dir}}" -ldflags "-X main.Version=`git describe --tags --abbrev=0`" - # Loop through the built architecture directories and create their corresponding tar.gz archives with the binary in it. - - find releases -maxdepth 2 -mindepth 2 -type f -exec bash -c 'tar -cvzf "$(dirname {}).tar.gz" -C "$(dirname {})" $(basename {})' \; - -deploy: - # See https://docs.travis-ci.com/user/deployment/releases/ - provider: releases - api_key: - secure: "Hnpq64pZL+CFaaqjQfxdAHWK3Hk+9F6CgzjaIo3K9puNAySsA1XVQHsqCV4P9v6hE5o3TjgQJZwpqLN/h53JPeZ1xwybj6sVyWwzQzNr99QGJH6Pr7g3mgVIIHyzy+4VqQ9Kw9PoNZEnq3y7wupNCjI+vN6WYWT9+gpMr4CsMyn3KEnpGREGgg964wMrBTdYoQxgNGLJtAkYwnHdYyVQaEA/9KZZUFhU8JwF0RzkBcXwgOzt9UhR9R7WgA+N2yLDFjlhmRtyTYsd2/4PX2FcsoEdUAAQBMBgw1fzBaIbUuhpT2/iNhQGs+ln/DHFPb5mUzG+JKDPEfdAAcT+h4tmIeND8gmKIspMAKsqXXZxkmi4PjobLE+rG0cUkMmnP879+ECB0buH4L8Aaxae0dMeURLxxfWhr7ytR4P93uC8KcSXrzXkx1BgqT6BasTxrxvdQQJUOCYtdWKV3w+ZsVi9YSvIoQTEL7Hy0F120mWTLYDtqtGr+VjdptUAwIi/ft8vniRimTV582Ry3v2gIstt9Wauyou8O+SA85wqpxCFJZNWX/2z8PhpHF02658ZLWpycHfwRjILwHl1c6THIyA56IZffj+8Y0yntbsFBm5nnrgGaStH/ln/N/ykWy80QzZlLfSZ2AkBC0m1qctebixmE4ekR+rF/z1mCIcRhrTaErM=" - file_glob: true # enables wildcards in file names - file: "releases/*.tar.gz" - skip_cleanup: true - on: - tags: true