-
Notifications
You must be signed in to change notification settings - Fork 487
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow to manually trigger a release against a self-hosted runn…
…er (#607) * add workflow to manually trigger a release against a self-hosted runner * use ref when checking out
- Loading branch information
Showing
1 changed file
with
113 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: Force Release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: "Tag to build for" | ||
required: true | ||
jobs: | ||
test: | ||
name: Test | ||
runs-on: Linux | ||
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 | ||
ref: '${{ github.events.inputs.tag }}' | ||
|
||
- name: Test | ||
run: make test | ||
agent-container: | ||
name: Build agent Container | ||
runs-on: Linux | ||
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 | ||
ref: '${{ github.events.inputs.tag }}' | ||
|
||
- 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.event.inputs.tag }} | ||
CROSS_BUILD=true RELEASE_BUILD=true make agent-image | ||
agentctl-container: | ||
name: Build agentctl Container | ||
runs-on: Linux | ||
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 | ||
ref: '${{ github.events.inputs.tag }}' | ||
|
||
- 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.event.inputs.tag }} | ||
CROSS_BUILD=true RELEASE_BUILD=true make agentctl-image | ||
release: | ||
name: Release | ||
needs: test | ||
runs-on: Linux | ||
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 | ||
ref: '${{ github.events.inputs.tag }}' | ||
|
||
- 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.event.inputs.tag }} | ||
make -j4 RELEASE_BUILD=true publish |