Skip to content
Snippets Groups Projects
Commit aca00a13 authored by JonasS's avatar JonasS
Browse files

Attempt Github CI release

- remove travis
- fix array literal
parent 2a7238dc
No related branches found
No related tags found
No related merge requests found
...@@ -26,9 +26,7 @@ jobs: ...@@ -26,9 +26,7 @@ jobs:
release: release:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: [ lint, build ] needs: [ lint, build ]
if: | if: ${{ startsWith(github.ref, 'refs/tags/') && contains(fromJSON('["mxschmitt", "JonasProgrammer"]'), github.actor) }}
${{ startsWith(github.ref, 'refs/tags/') &&
contains(['mxschmitt', 'JonasProgrammer'], github.actor) }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Run GoReleaser - name: Run GoReleaser
......
# 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment