From 509524bd140dbf00726f22921b99f237ea0eb9ba Mon Sep 17 00:00:00 2001 From: Gianluca Arbezzano Date: Wed, 18 Nov 2020 10:55:42 +0100 Subject: [PATCH] Add continuous integration workflow Signed-off-by: Gianluca Arbezzano --- .github/workflows/ci.yaml | 2 +- .github/workflows/tags.yaml | 33 ++++++++++ current_versions.sh | 12 ++++ generate-envrc.sh | 14 ++-- go.mod | 12 +--- go.sum | 124 +++++++++++++++--------------------- script/release-binaries.sh | 28 ++++++++ shell.nix | 6 +- 8 files changed, 136 insertions(+), 95 deletions(-) create mode 100644 .github/workflows/tags.yaml create mode 100644 current_versions.sh create mode 100755 script/release-binaries.sh diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b990498..b1d0ba1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ on: pull_request: jobs: - validation: + build: runs-on: ubuntu-latest steps: - name: Checkout code diff --git a/.github/workflows/tags.yaml b/.github/workflows/tags.yaml new file mode 100644 index 0000000..26e2a20 --- /dev/null +++ b/.github/workflows/tags.yaml @@ -0,0 +1,33 @@ +on: + push: + tags: + - "v*" +name: Create release +jobs: + release: + runs-on: ubuntu-latest + steps: + - run: sudo apt install -y libgpgme-dev libassuan-dev libdevmapper-dev + - name: Checkout code + uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: "1.15.5" + - run: ./script/release-binaries.sh + name: get binaries + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload release binaries + uses: alexellis/upload-assets@0.2.2 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + asset_paths: '["./out/release/*"]' diff --git a/current_versions.sh b/current_versions.sh new file mode 100644 index 0000000..4d7651c --- /dev/null +++ b/current_versions.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# This file gets used from generate-envrc.sh but it is also used standalone by +# automation that needs to get the version of the programs currently supported +# in sandbox + +export OSIE_DOWNLOAD_LINK=https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/osie-v0-n=366,c=1aec189,b=master.tar.gz +export TINKERBELL_TINK_SERVER_IMAGE=quay.io/tinkerbell/tink:sha-0e8e5733 +export TINKERBELL_TINK_CLI_IMAGE=quay.io/tinkerbell/tink-cli:sha-0e8e5733 +export TINKERBELL_TINK_BOOTS_IMAGE=quay.io/tinkerbell/boots:sha-e81a291c +export TINKERBELL_TINK_HEGEL_IMAGE=quay.io/tinkerbell/hegel:sha-c17b512f +export TINKERBELL_TINK_WORKER_IMAGE=quay.io/tinkerbell/tink-worker:sha-0e8e5733 diff --git a/generate-envrc.sh b/generate-envrc.sh index 83fa7c2..49d7064 100755 --- a/generate-envrc.sh +++ b/generate-envrc.sh @@ -11,6 +11,8 @@ fi ERR="${RED:-}ERROR:${RESET:-}" +source ./current_versions.sh + err() ( if [ -z "${1:-}" ]; then cat >&2 @@ -54,12 +56,12 @@ generate_envrc() ( cat <