Update dependencies #107
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
name: Main | |
on: | |
push: | |
branches: | |
- '**' | |
tags: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup Go | |
uses: actions/setup-go@v2 | |
- name: Print Go Version | |
run: go version | |
- name: Build | |
run: | | |
./ci/build.sh | |
- name: Test plugin | |
run: | | |
./ci/test.sh plugin | |
- name: Test tools | |
run: | | |
./ci/test.sh tools | |
- name: Compute Tag | |
if: | | |
github.event_name == 'push' | |
&& startsWith(github.event.ref, 'refs/tags/') | |
id: compute_tag | |
run: | | |
tag=${GITHUB_REF#refs/tags/} | |
if [ "$tag" != "$GITHUB_REF" ]; then | |
tag=$(echo "$tag" | sed -e 's/[^a-zA-Z0-9\-\.]/-/g') | |
echo ::set-output name=TAG::${tag} | |
else | |
echo "unable to determine tag" >&2 | |
exit 1 | |
fi | |
- name: Release | |
if: | | |
github.event_name == 'push' | |
&& startsWith(github.event.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./ci/release.sh "${{ steps.compute_tag.outputs.TAG }}" | |
assets=() | |
for asset in $(ls releases); do | |
assets+=("-a" "releases/$asset") | |
done | |
hub release create "${assets[@]}" \ | |
-m "${{ steps.compute_tag.outputs.TAG }}" \ | |
"${{ steps.compute_tag.outputs.TAG }}" | |
- name: Set up Buildx | |
if: | | |
github.event_name == 'push' | |
&& startsWith(github.event.ref, 'refs/tags/') | |
uses: docker/setup-buildx-action@v1 | |
id: buildx | |
with: | |
version: v0.5.1 | |
driver: docker-container | |
install: true | |
buildkitd-flags: --debug | |
- name: Login to Docker HUB | |
if: | | |
github.event_name == 'push' | |
&& startsWith(github.event.ref, 'refs/tags/') | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Docker Release | |
if: | | |
github.event_name == 'push' | |
&& startsWith(github.event.ref, 'refs/tags/') | |
run: | | |
./ci/docker.sh "${{ steps.compute_tag.outputs.TAG }}" |