Skip to content

Commit

Permalink
Add continuous integration workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Gianluca Arbezzano <[email protected]>
  • Loading branch information
Gianluca Arbezzano committed Nov 19, 2020
1 parent 45f5934 commit 509524b
Show file tree
Hide file tree
Showing 8 changed files with 136 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
pull_request:

jobs:
validation:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/tags.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
asset_paths: '["./out/release/*"]'
12 changes: 12 additions & 0 deletions current_versions.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 8 additions & 6 deletions generate-envrc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ fi

ERR="${RED:-}ERROR:${RESET:-}"

source ./current_versions.sh

err() (
if [ -z "${1:-}" ]; then
cat >&2
Expand Down Expand Up @@ -54,12 +56,12 @@ generate_envrc() (
cat <<EOF
# Tinkerbell Stack version
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
export OSIE_DOWNLOAD_LINK=${OSIE_DOWNLOAD_LINK}
export TINKERBELL_TINK_SERVER_IMAGE=${TINKERBELL_TINK_SERVER_IMAGE}
export TINKERBELL_TINK_CLI_IMAGE=${TINKERBELL_TINK_CLI_IMAGE}
export TINKERBELL_TINK_BOOTS_IMAGE=${TINKERBELL_TINK_BOOTS_IMAGE}
export TINKERBELL_TINK_HEGEL_IMAGE=${TINKERBELL_TINK_HEGEL_IMAGE}
export TINKERBELL_TINK_WORKER_IMAGE=${TINKERBELL_TINK_WORKER_IMAGE}
# Network interface for Tinkerbell's network
export TINKERBELL_NETWORK_INTERFACE="$tink_interface"
Expand Down
12 changes: 1 addition & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,5 @@ go 1.15

require (
github.com/containers/image v3.0.2+incompatible
github.com/containers/image/v5 v5.6.0
github.com/golang/protobuf v1.4.2 // indirect
github.com/google/go-cmp v0.5.2 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
github.com/prometheus/client_golang v1.3.0 // indirect
golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a // indirect
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 // indirect
golang.org/x/text v0.3.3 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
github.com/containers/image/v5 v5.8.0
)
124 changes: 50 additions & 74 deletions go.sum

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions script/release-binaries.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

source ./current_versions.sh

go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/hegel \
-image docker://quay.io/tinkerbell/hegel:sha-c17b512f \
-program hegel

go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/boots \
-image docker://quay.io/tinkerbell/boots:sha-e81a291c \
-program boots

go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/tink-worker \
-image docker://quay.io/tinkerbell/tink-worker:sha-0e8e5733 \
-program tink-worker

go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/tink-server \
-image docker://quay.io/tinkerbell/tink:sha-0e8e5733 \
-program tink-server

go run cmd/getbinariesfromquay/main.go \
-binary-to-copy /usr/bin/tink \
-image docker://quay.io/tinkerbell/tink-cli:sha-0e8e5733 \
-program tink
6 changes: 3 additions & 3 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ in
(_pkgs.fetchFromGitHub {
owner = "NixOS";
repo = "nixpkgs";
#branch@date: nixpkgs-unstable@2020-11-04
rev = "dfea4e4951a3cee4d1807d8d4590189cf16f366b";
sha256 = "02j7f5l2p08144b2fb7pg6sbni5km5y72k3nk3i7irddx8j2s04i";
#branch@date: nixpkgs-unstable@2020-11-19
rev = "4f3475b113c93d204992838aecafa89b1b3ccfde";
sha256 = "158iik656ds6i6pc672w54cnph4d44d0a218dkq6npzrbhd3vvbg";
}) { }
}:

Expand Down

0 comments on commit 509524b

Please sign in to comment.