Merge branch 'main' of github.com:grafana/agent #2
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get build dependencies | |
run: sudo apt-get update && sudo apt-get install libsystemd-dev | |
- name: Set up Go 1.16 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.16 | |
id: go | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Test | |
run: make test | |
agent-container: | |
name: Build agent Container | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Get build dependencies | |
run: sudo apt-get update && sudo apt-get install binfmt-support qemu-user-static | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
run: docker login -u '${{ secrets.DOCKER_USER }}' -p '${{ secrets.DOCKER_PASS }}' | |
- name: Prepare buildx | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
docker buildx create --name builder --driver docker-container --use | |
docker buildx inspect --bootstrap | |
- name: Build container | |
run: | | |
export RELEASE_TAG=${GITHUB_REF##*/} | |
CROSS_BUILD=true RELEASE_BUILD=true make agent-image | |
agentctl-container: | |
name: Build agentctl Container | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- name: Get build dependencies | |
run: sudo apt-get update && sudo apt-get install binfmt-support qemu-user-static | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Login to Docker Hub | |
run: docker login -u '${{ secrets.DOCKER_USER }}' -p '${{ secrets.DOCKER_PASS }}' | |
- name: Prepare buildx | |
run: | | |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | |
docker buildx create --name builder --driver docker-container --use | |
docker buildx inspect --bootstrap | |
- name: Build container | |
run: | | |
export RELEASE_TAG=${GITHUB_REF##*/} | |
CROSS_BUILD=true RELEASE_BUILD=true make agentctl-image | |
release: | |
name: Release | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get build dependencies | |
run: sudo apt-get update && sudo apt-get install libsystemd-dev | |
- name: Set up Go 1.16 | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.16 | |
id: go | |
- name: Install gox and ghr | |
run: | | |
pushd / | |
GO111MODULE=on go get -u \ | |
github.com/mitchellh/gox \ | |
github.com/tcnksm/ghr | |
popd | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Make Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
# This is required so gox and ghr are available | |
export PATH="$(go env GOPATH)/bin:$PATH" | |
export RELEASE_TAG=${GITHUB_REF##*/} | |
make -j4 RELEASE_BUILD=true publish |