2023-03-22 13:17:19 +00:00
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
2021-10-26 06:01:18 +00:00
name : build
on :
push :
# Sequence of patterns matched against refs/heads
2022-01-06 19:32:35 +00:00
branches :
# Push events on the main branch
- main
2022-08-01 19:56:55 +00:00
- release/**
2021-10-29 05:22:38 +00:00
2021-10-26 06:01:18 +00:00
env :
PKG_NAME : consul
2023-08-22 14:46:03 +00:00
# TODO(spatel): CE refactor
2023-01-05 20:16:47 +00:00
METADATA : oss
2023-06-21 15:26:27 +00:00
GOPRIVATE : github.com/hashicorp # Required for enterprise deps
2021-10-26 06:01:18 +00:00
jobs :
2023-01-05 20:16:47 +00:00
set-product-version :
2021-10-26 06:01:18 +00:00
runs-on : ubuntu-latest
outputs :
2023-01-05 20:16:47 +00:00
product-version : ${{ steps.set-product-version.outputs.product-version }}
base-product-version : ${{ steps.set-product-version.outputs.base-product-version }}
2022-03-24 01:26:42 +00:00
product-date : ${{ steps.get-product-version.outputs.product-date }}
2023-01-05 20:16:47 +00:00
pre-version : ${{ steps.set-product-version.outputs.prerelease-product-version }}
2021-10-26 06:01:18 +00:00
shared-ldflags : ${{ steps.shared-ldflags.outputs.shared-ldflags }}
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2023-10-18 19:39:52 +00:00
# action-set-product-version implicitly sets fields like 'product-version' using version/VERSION
# https://github.com/hashicorp/actions-set-product-version
2023-01-05 20:16:47 +00:00
- name : set product version
id : set-product-version
uses : hashicorp/actions-set-product-version@v1
2021-10-26 06:01:18 +00:00
- name : get product version
id : get-product-version
run : |
2022-06-02 02:29:40 +00:00
CONSUL_DATE=$(build-support/scripts/build-date.sh)
2023-05-30 15:17:53 +00:00
echo "product-date=${CONSUL_DATE}" >> "$GITHUB_OUTPUT"
2021-10-26 06:01:18 +00:00
- name : Set shared -ldflags
id : shared-ldflags
2022-03-24 01:26:42 +00:00
run : |
T="github.com/hashicorp/consul/version"
2023-05-30 15:17:53 +00:00
echo "shared-ldflags=-X ${T}.GitCommit=${GITHUB_SHA::8} \
2023-01-05 20:16:47 +00:00
-X ${T}.GitDescribe=${{ steps.set-product-version.outputs.product-version }} \
-X ${T}.BuildDate=${{ steps.get-product-version.outputs.product-date }} \
2023-05-30 15:17:53 +00:00
" >> " $GITHUB_OUTPUT"
2023-01-05 20:16:47 +00:00
validate-outputs :
needs : set-product-version
runs-on : ubuntu-latest
steps :
- name : Validate Outputs
run : |
echo "Product Version: ${{ needs.set-product-version.outputs.product-version }}"
echo "Base Product Version: ${{ needs.set-product-version.outputs.base-product-version }}"
echo "Product Metadata: ${{ env.METADATA }}"
echo "Product Date: ${{ needs.set-product-version.outputs.product-date }}"
echo "Prerelease Version: ${{ needs.set-product-version.outputs.pre-version }}"
echo "Ldflags: ${{ needs.set-product-version.outputs.shared-ldflags }}"
2023-07-12 23:10:34 +00:00
2021-10-26 06:01:18 +00:00
generate-metadata-file :
2023-01-05 20:16:47 +00:00
needs : set-product-version
2021-10-26 06:01:18 +00:00
runs-on : ubuntu-latest
outputs :
filepath : ${{ steps.generate-metadata-file.outputs.filepath }}
steps :
- name : 'Checkout directory'
2023-07-19 23:56:50 +00:00
uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2021-10-26 06:01:18 +00:00
- name : Generate metadata file
id : generate-metadata-file
2022-04-22 16:26:12 +00:00
uses : hashicorp/actions-generate-metadata@v1
2021-10-26 06:01:18 +00:00
with :
2023-01-05 20:16:47 +00:00
version : ${{ needs.set-product-version.outputs.product-version }}
2021-10-26 06:01:18 +00:00
product : ${{ env.PKG_NAME }}
2023-06-13 17:00:55 +00:00
- uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
2021-10-26 06:01:18 +00:00
with :
name : metadata.json
path : ${{ steps.generate-metadata-file.outputs.filepath }}
build :
2023-01-05 20:16:47 +00:00
needs : set-product-version
2021-10-26 06:01:18 +00:00
runs-on : ubuntu-latest
strategy :
matrix :
include :
2023-10-16 21:49:04 +00:00
- {go : "1.20.10" , goos : "linux" , goarch : "386" }
- {go : "1.20.10" , goos : "linux" , goarch : "amd64" }
- {go : "1.20.10" , goos : "linux" , goarch : "arm" }
- {go : "1.20.10" , goos : "linux" , goarch : "arm64" }
- {go : "1.20.10" , goos : "freebsd" , goarch : "386" }
- {go : "1.20.10" , goos : "freebsd" , goarch : "amd64" }
- {go : "1.20.10" , goos : "windows" , goarch : "386" }
- {go : "1.20.10" , goos : "windows" , goarch : "amd64" }
- {go : "1.20.10" , goos : "solaris" , goarch : "amd64" }
2021-10-26 06:01:18 +00:00
fail-fast : true
name : Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2021-10-26 06:01:18 +00:00
- name : Setup with node and yarn
2023-07-19 23:56:50 +00:00
uses : actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
2021-10-26 06:01:18 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : '18'
2021-10-26 06:01:18 +00:00
cache : 'yarn'
cache-dependency-path : 'ui/yarn.lock'
- name : Build UI
run : |
2023-01-05 20:16:47 +00:00
CONSUL_VERSION=${{ needs.set-product-version.outputs.product-version }}
CONSUL_DATE=${{ needs.set-product-version.outputs.product-date }}
2021-10-26 06:01:18 +00:00
CONSUL_BINARY_TYPE=${CONSUL_BINARY_TYPE}
CONSUL_COPYRIGHT_YEAR=$(git show -s --format=%cd --date=format:%Y HEAD)
echo "consul_version is ${CONSUL_VERSION}"
2022-06-02 02:29:40 +00:00
echo "consul_date is ${CONSUL_DATE}"
2021-10-26 06:01:18 +00:00
echo "consul binary type is ${CONSUL_BINARY_TYPE}"
echo "consul copyright year is ${CONSUL_COPYRIGHT_YEAR}"
cd ui && make && cd ..
2022-05-31 19:33:56 +00:00
rm -rf agent/uiserver/dist
mv ui/packages/consul-ui/dist agent/uiserver/
2023-01-05 20:16:47 +00:00
- name : Go Build
2021-10-26 06:01:18 +00:00
env :
2023-01-05 20:16:47 +00:00
PRODUCT_VERSION : ${{ needs.set-product-version.outputs.product-version }}
PRERELEASE_VERSION : ${{ needs.set-product-version.outputs.pre-version }}
CGO_ENABLED : "0"
GOLDFLAGS : "${{needs.set-product-version.outputs.shared-ldflags}}"
uses : hashicorp/actions-go-build@v0.1.7
2021-10-26 06:01:18 +00:00
with :
2023-01-05 20:16:47 +00:00
product_name : ${{ env.PKG_NAME }}
product_version : ${{ needs.set-product-version.outputs.product-version }}
go_version : ${{ matrix.go }}
os : ${{ matrix.goos }}
arch : ${{ matrix.goarch }}
reproducible : report
instructions : |-
go build -ldflags="$GOLDFLAGS" -o "$BIN_PATH" -trimpath -buildvcs=false
2021-10-26 06:01:18 +00:00
- name : Package
if : ${{ matrix.goos == 'linux' }}
uses : hashicorp/actions-packaging-linux@v1
with :
name : ${{ github.event.repository.name }}
description : "Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure. "
arch : ${{ matrix.goarch }}
2023-01-05 20:16:47 +00:00
version : ${{ needs.set-product-version.outputs.product-version }}
2021-10-26 06:01:18 +00:00
maintainer : "HashiCorp"
homepage : "https://github.com/hashicorp/consul"
license : "MPL-2.0"
binary : "dist/${{ env.PKG_NAME }}"
deb_depends : "openssl"
rpm_depends : "openssl"
config_dir : ".release/linux/package"
preinstall : ".release/linux/preinstall"
postinstall : ".release/linux/postinstall"
2022-02-01 20:07:18 +00:00
preremove : ".release/linux/preremove"
2021-10-26 06:01:18 +00:00
postremove : ".release/linux/postremove"
- name : Set Package Names
if : ${{ matrix.goos == 'linux' }}
run : |
echo "RPM_PACKAGE=$(basename out/*.rpm)" >> $GITHUB_ENV
echo "DEB_PACKAGE=$(basename out/*.deb)" >> $GITHUB_ENV
2023-06-13 17:00:55 +00:00
- uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
2021-10-26 06:01:18 +00:00
if : ${{ matrix.goos == 'linux' }}
with :
name : ${{ env.RPM_PACKAGE }}
path : out/${{ env.RPM_PACKAGE }}
2023-06-13 17:00:55 +00:00
- uses : actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
2021-10-26 06:01:18 +00:00
if : ${{ matrix.goos == 'linux' }}
with :
name : ${{ env.DEB_PACKAGE }}
path : out/${{ env.DEB_PACKAGE }}
2023-07-12 23:10:34 +00:00
build-s390x :
needs : set-product-version
if : ${{ endsWith(github.repository, '-enterprise') }}
runs-on : ubuntu-latest
strategy :
matrix :
include :
2023-10-16 21:49:04 +00:00
- {go : "1.20.10" , goos : "linux" , goarch : "s390x" }
2023-07-12 23:10:34 +00:00
fail-fast : true
name : Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2023-07-12 23:10:34 +00:00
- name : Setup with node and yarn
2023-07-19 23:56:50 +00:00
uses : actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
2023-07-12 23:10:34 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : '18'
2023-07-12 23:10:34 +00:00
cache : 'yarn'
cache-dependency-path : 'ui/yarn.lock'
- name : Build UI
run : |
CONSUL_VERSION=${{ needs.set-product-version.outputs.product-version }}
CONSUL_DATE=${{ needs.set-product-version.outputs.product-date }}
CONSUL_BINARY_TYPE=${CONSUL_BINARY_TYPE}
CONSUL_COPYRIGHT_YEAR=$(git show -s --format=%cd --date=format:%Y HEAD)
echo "consul_version is ${CONSUL_VERSION}"
echo "consul_date is ${CONSUL_DATE}"
echo "consul binary type is ${CONSUL_BINARY_TYPE}"
echo "consul copyright year is ${CONSUL_COPYRIGHT_YEAR}"
cd ui && make && cd ..
rm -rf agent/uiserver/dist
mv ui/packages/consul-ui/dist agent/uiserver/
- name : Go Build
env :
PRODUCT_VERSION : ${{ needs.set-product-version.outputs.product-version }}
PRERELEASE_VERSION : ${{ needs.set-product-version.outputs.pre-version }}
CGO_ENABLED : "0"
GOLDFLAGS : "${{needs.set-product-version.outputs.shared-ldflags}}"
uses : hashicorp/actions-go-build@v0.1.7
with :
product_name : ${{ env.PKG_NAME }}
product_version : ${{ needs.set-product-version.outputs.product-version }}
go_version : ${{ matrix.go }}
os : ${{ matrix.goos }}
arch : ${{ matrix.goarch }}
reproducible : report
instructions : |-
go build -ldflags="$GOLDFLAGS" -o "$BIN_PATH" -trimpath -buildvcs=false
2021-10-26 06:01:18 +00:00
build-darwin :
2023-01-05 20:16:47 +00:00
needs : set-product-version
2021-10-26 06:01:18 +00:00
runs-on : macos-latest
strategy :
matrix :
goos : [ darwin ]
2021-12-15 01:46:04 +00:00
goarch : [ "amd64" , "arm64" ]
2023-10-16 21:49:04 +00:00
go : [ "1.20.10" ]
2021-10-26 06:01:18 +00:00
fail-fast : true
name : Go ${{ matrix.go }} ${{ matrix.goos }} ${{ matrix.goarch }} build
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2023-07-12 23:10:34 +00:00
2021-10-26 06:01:18 +00:00
- name : Setup with node and yarn
2023-07-19 23:56:50 +00:00
uses : actions/setup-node@e33196f7422957bea03ed53f6fbb155025ffc7b8 # v3.7.0
2021-10-26 06:01:18 +00:00
with :
2023-10-23 18:29:04 +00:00
node-version : '18'
2021-10-26 06:01:18 +00:00
cache : 'yarn'
cache-dependency-path : 'ui/yarn.lock'
- name : Build UI
run : |
2023-01-05 20:16:47 +00:00
CONSUL_VERSION=${{ needs.set-product-version.outputs.product-version }}
2021-10-26 06:01:18 +00:00
CONSUL_BINARY_TYPE=${CONSUL_BINARY_TYPE}
CONSUL_COPYRIGHT_YEAR=$(git show -s --format=%cd --date=format:%Y HEAD)
echo "consul_version is ${CONSUL_VERSION}"
echo "consul binary type is ${CONSUL_BINARY_TYPE}"
echo "consul copyright year is ${CONSUL_COPYRIGHT_YEAR}"
cd ui && make && cd ..
2022-05-31 19:33:56 +00:00
rm -rf agent/uiserver/dist
mv ui/packages/consul-ui/dist agent/uiserver/
2023-01-05 20:16:47 +00:00
- name : Go Build
2021-10-26 06:01:18 +00:00
env :
2023-01-05 20:16:47 +00:00
PRODUCT_VERSION : ${{ needs.set-product-version.outputs.product-version }}
PRERELEASE_VERSION : ${{ needs.set-product-version.outputs.pre-version }}
CGO_ENABLED : "0"
GOLDFLAGS : "${{needs.set-product-version.outputs.shared-ldflags}}"
uses : hashicorp/actions-go-build@v0.1.7
2021-10-26 06:01:18 +00:00
with :
2023-01-05 20:16:47 +00:00
product_name : ${{ env.PKG_NAME }}
product_version : ${{ needs.set-product-version.outputs.product-version }}
go_version : ${{ matrix.go }}
os : ${{ matrix.goos }}
arch : ${{ matrix.goarch }}
reproducible : report
instructions : |-
go build -ldflags="$GOLDFLAGS" -tags netcgo -o "$BIN_PATH" -trimpath -buildvcs=false
2021-10-26 06:01:18 +00:00
build-docker :
name : Docker ${{ matrix.arch }} build
needs :
2023-01-05 20:16:47 +00:00
- set-product-version
2021-10-26 06:01:18 +00:00
- build
runs-on : ubuntu-latest
strategy :
matrix :
2023-07-24 15:22:34 +00:00
include :
- { arch : "386" }
- { arch : "arm" }
- { arch : "amd64" }
- { arch : "arm64" }
2021-10-26 06:01:18 +00:00
env :
repo : ${{github.event.repository.name}}
2023-01-05 20:16:47 +00:00
version : ${{needs.set-product-version.outputs.product-version}}
2021-10-26 06:01:18 +00:00
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2022-06-24 20:45:57 +00:00
# Strip everything but MAJOR.MINOR from the version string and add a `-dev` suffix
# This naming convention will be used ONLY for per-commit dev images
- name : Set docker dev tag
run : |
2023-10-18 19:39:52 +00:00
echo "full_dev_tag=${{ env.version }}"
echo "full_dev_tag=${{ env.version }}" >> $GITHUB_ENV
echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')"
echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')" >> $GITHUB_ENV
2022-06-24 20:45:57 +00:00
2021-10-26 06:01:18 +00:00
- name : Docker Build (Action)
uses : hashicorp/actions-docker-build@v1
with :
version : ${{env.version}}
target : default
arch : ${{matrix.arch}}
tags : |
docker.io/hashicorp/${{env.repo}}:${{env.version}}
2021-12-15 21:17:16 +00:00
public.ecr.aws/hashicorp/${{env.repo}}:${{env.version}}
2022-05-17 19:23:03 +00:00
dev_tags : |
2023-10-18 19:39:52 +00:00
docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }}
docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }}-${{ github.sha }}
docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }}
docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }}-${{ github.sha }}
2022-06-06 21:42:11 +00:00
smoke_test : .github/scripts/verify_docker.sh v${{ env.version }}
2022-05-26 16:49:47 +00:00
2022-07-25 22:43:24 +00:00
build-docker-ubi-redhat :
name : Docker Build UBI Image for RedHat Registry
2022-05-26 16:49:47 +00:00
needs :
2023-01-05 20:16:47 +00:00
- set-product-version
2022-05-26 16:49:47 +00:00
- build
runs-on : ubuntu-latest
env :
repo : ${{github.event.repository.name}}
2023-01-05 20:16:47 +00:00
version : ${{needs.set-product-version.outputs.product-version}}
2022-05-26 16:49:47 +00:00
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2022-05-26 16:49:47 +00:00
- uses : hashicorp/actions-docker-build@v1
with :
version : ${{env.version}}
target : ubi
arch : amd64
2022-10-20 15:01:38 +00:00
redhat_tag : quay.io/redhat-isv-containers/60f9fdbec3a80eac643abedf:${{env.version}}-ubi
2022-06-06 21:42:11 +00:00
smoke_test : .github/scripts/verify_docker.sh v${{ env.version }}
2022-07-25 22:43:24 +00:00
build-docker-ubi-dockerhub :
name : Docker Build UBI Image for DockerHub
needs :
2023-01-05 20:16:47 +00:00
- set-product-version
2022-07-25 22:43:24 +00:00
- build
runs-on : ubuntu-latest
env :
repo : ${{github.event.repository.name}}
2023-01-05 20:16:47 +00:00
version : ${{needs.set-product-version.outputs.product-version}}
2022-07-25 22:43:24 +00:00
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2022-07-25 22:43:24 +00:00
# Strip everything but MAJOR.MINOR from the version string and add a `-dev` suffix
# This naming convention will be used ONLY for per-commit dev images
- name : Set docker dev tag
run : |
2023-10-18 19:39:52 +00:00
echo "full_dev_tag=${{ env.version }}"
echo "full_dev_tag=${{ env.version }}" >> $GITHUB_ENV
echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')"
echo "minor_dev_tag=$(echo ${{ env.version }}| sed -E 's/([0-9]+\.[0-9]+)\.[0-9]+(-[0-9a-zA-Z\+\.]+)?$/\1\2/')" >> $GITHUB_ENV
2022-07-25 22:43:24 +00:00
- uses : hashicorp/actions-docker-build@v1
with :
version : ${{env.version}}
target : ubi
arch : amd64
tags : |
docker.io/hashicorp/${{env.repo}}:${{env.version}}-ubi
public.ecr.aws/hashicorp/${{env.repo}}:${{env.version}}-ubi
dev_tags : |
2023-10-18 19:39:52 +00:00
docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }}-ubi
docker.io/hashicorppreview/${{ env.repo }}:${{ env.full_dev_tag }}-ubi-${{ github.sha }}
docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }}-ubi
docker.io/hashicorppreview/${{ env.repo }}:${{ env.minor_dev_tag }}-ubi-${{ github.sha }}
2022-07-25 22:43:24 +00:00
smoke_test : .github/scripts/verify_docker.sh v${{ env.version }}
2022-06-06 21:42:11 +00:00
verify-linux :
2022-05-27 18:50:41 +00:00
needs :
2023-01-05 20:16:47 +00:00
- set-product-version
2022-05-27 18:50:41 +00:00
- build
runs-on : ubuntu-latest
strategy :
matrix :
2023-07-24 15:22:34 +00:00
include :
- { arch : "386" }
- { arch : "arm" }
- { arch : "amd64" }
- { arch : "arm64" }
2022-05-27 18:50:41 +00:00
fail-fast : true
env :
2023-01-05 20:16:47 +00:00
version : ${{ needs.set-product-version.outputs.product-version }}
zip_name : consul_${{ needs.set-product-version.outputs.product-version }}_linux_${{ matrix.arch }}.zip
2022-06-06 21:42:11 +00:00
name : Verify ${{ matrix.arch }} linux binary
2022-05-27 18:50:41 +00:00
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2023-07-12 23:10:34 +00:00
if : ${{ endsWith(github.repository, '-enterprise') || matrix.arch != 's390x' }}
2022-06-06 21:42:11 +00:00
- name : Download ${{ matrix.arch }} zip
2023-07-12 23:10:34 +00:00
if : ${{ endsWith(github.repository, '-enterprise') || matrix.arch != 's390x' }}
2023-06-13 17:00:55 +00:00
uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
2022-05-27 18:50:41 +00:00
with :
2022-06-06 21:42:11 +00:00
name : ${{ env.zip_name }}
- name : Set up QEMU
2023-07-19 23:56:50 +00:00
uses : docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
2022-06-06 21:42:11 +00:00
if : ${{ matrix.arch == 'arm' || matrix.arch == 'arm64' }}
with :
# this should be a comma-separated string as opposed to an array
platforms : arm,arm64
- name : Run verification for ${{ matrix.arch }} binary
2023-07-12 23:10:34 +00:00
if : ${{ endsWith(github.repository, '-enterprise') || matrix.arch != 's390x' }}
2022-06-06 21:42:11 +00:00
run : .github/scripts/verify_artifact.sh ${{ env.zip_name }} v${{ env.version }}
2022-05-27 18:50:41 +00:00
verify-darwin :
needs :
2023-01-05 20:16:47 +00:00
- set-product-version
2022-05-27 18:50:41 +00:00
- build-darwin
runs-on : macos-latest
strategy :
fail-fast : true
env :
2023-01-05 20:16:47 +00:00
version : ${{needs.set-product-version.outputs.product-version}}
zip_name : consul_${{ needs.set-product-version.outputs.product-version }}_darwin_amd64.zip
2022-06-06 21:42:11 +00:00
name : Verify amd64 darwin binary
2022-05-27 18:50:41 +00:00
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2022-06-06 21:42:11 +00:00
- name : Download amd64 darwin zip
2023-06-13 17:00:55 +00:00
uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
2022-05-27 18:50:41 +00:00
with :
2022-06-06 21:42:11 +00:00
name : ${{ env.zip_name }}
- name : Unzip amd64 darwin zip
run : unzip ${{ env.zip_name }}
- name : Run verification for amd64 darwin binary
run : .github/scripts/verify_bin.sh ./consul v${{ env.version }}
2022-05-27 18:50:41 +00:00
verify-linux-packages-deb :
2022-06-06 21:42:11 +00:00
needs :
- build
2023-01-05 20:16:47 +00:00
- set-product-version
2022-05-27 18:50:41 +00:00
runs-on : ubuntu-latest
strategy :
matrix :
2023-07-24 15:22:34 +00:00
include :
- { arch : "i386" }
- { arch : "armhf" }
- { arch : "amd64" }
- { arch : "arm64" }
2022-06-06 21:42:11 +00:00
# fail-fast: true
env :
2023-01-05 20:16:47 +00:00
version : ${{ needs.set-product-version.outputs.product-version }}
2022-05-27 18:50:41 +00:00
name : Verify ${{ matrix.arch }} debian package
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2022-06-16 12:27:37 +00:00
2022-06-06 21:42:11 +00:00
- name : Set package version
run : |
2023-01-05 20:16:47 +00:00
echo "pkg_version=$(echo ${{ needs.set-product-version.outputs.product-version }} | sed 's/\-/~/g')" >> $GITHUB_ENV
2022-05-27 18:50:41 +00:00
2022-06-06 21:42:11 +00:00
- name : Set package name
2022-05-27 18:50:41 +00:00
run : |
2022-06-16 12:27:37 +00:00
echo "pkg_name=consul_${{ env.pkg_version }}-1_${{ matrix.arch }}.deb" >> $GITHUB_ENV
2022-06-06 21:42:11 +00:00
- name : Download workflow artifacts
2023-06-13 17:00:55 +00:00
uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
2022-06-06 21:42:11 +00:00
with :
name : ${{ env.pkg_name }}
- name : Set up QEMU
2023-07-19 23:56:50 +00:00
uses : docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
2022-06-06 21:42:11 +00:00
with :
platforms : all
2022-05-27 18:50:41 +00:00
- name : Verify ${{ matrix.arch }} debian package
2022-06-06 21:42:11 +00:00
run : ./.github/scripts/verify_artifact.sh ${{ env.pkg_name }} v${{ env.version }}
2022-05-27 18:50:41 +00:00
verify-linux-packages-rpm :
2022-06-06 21:42:11 +00:00
needs :
- build
2023-01-05 20:16:47 +00:00
- set-product-version
2022-05-27 18:50:41 +00:00
runs-on : ubuntu-latest
strategy :
matrix :
2023-07-24 15:22:34 +00:00
include :
- { arch : "i386" }
- { arch : "x86_64" }
2022-08-11 17:26:21 +00:00
# TODO(eculver): re-enable when there is a smaller verification container available
2023-07-24 15:22:34 +00:00
# - { arch: "armv7hl" }
# - { arch: "aarch64" }
2022-06-06 21:42:11 +00:00
env :
2023-01-05 20:16:47 +00:00
version : ${{ needs.set-product-version.outputs.product-version }}
2022-05-27 18:50:41 +00:00
2022-06-06 21:42:11 +00:00
name : Verify ${{ matrix.arch }} rpm
2022-05-27 18:50:41 +00:00
steps :
2023-07-19 23:56:50 +00:00
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
2022-05-27 18:50:41 +00:00
2022-06-06 21:42:11 +00:00
- name : Set package version
2022-05-27 18:50:41 +00:00
run : |
2023-01-05 20:16:47 +00:00
echo "pkg_version=$(echo ${{ needs.set-product-version.outputs.product-version }} | sed 's/\-/~/g')" >> $GITHUB_ENV
2022-05-27 18:50:41 +00:00
2022-06-06 21:42:11 +00:00
- name : Set package name
2022-05-27 18:50:41 +00:00
run : |
2022-06-16 12:27:37 +00:00
echo "pkg_name=consul-${{ env.pkg_version }}-1.${{ matrix.arch }}.rpm" >> $GITHUB_ENV
2022-06-06 21:42:11 +00:00
- name : Download workflow artifacts
2023-06-13 17:00:55 +00:00
uses : actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
2022-06-06 21:42:11 +00:00
with :
name : ${{ env.pkg_name }}
- name : Set up QEMU
2023-07-19 23:56:50 +00:00
uses : docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2.2.0
2022-06-06 21:42:11 +00:00
with :
platforms : all
2022-06-16 12:27:37 +00:00
- name : Verify ${{ matrix.arch }} rpm
2022-06-06 21:42:11 +00:00
run : ./.github/scripts/verify_artifact.sh ${{ env.pkg_name }} v${{ env.version }}