Skip to content

fix package

fix package #3

name: 'Setup, Build and Publish'
on:
workflow_call:
inputs:
branch_name:
type: string
description: 'Branch name'
required: true
image_version:
type: string
description: 'Image version for docker hub'
required: true
cmake_options:
type: string
description: 'Additional cmake options'
required: false
build_type:
type: string
description: 'Build type of skaled binary'
required: true
node_type:
type: string
description: 'Node type of skaled build'
required: true
secrets:
DOCKER_USERNAME:
required: true
DOCKER_PASSWORD:
required: true
jobs:
main:
runs-on: self-hosted
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
BUILD_TYPE: ${{ inputs.build_type }}
steps:
- name: Prepare workflow variables
if: inputs.node_type != 'historic'
run: |
[[ $BUILD_TYPE = "Debug" ]] && export VERSION_SUFFIX=debug || export VERSION_SUFFIX=release
export VERSION=${{ inputs.image_version }}-$VERSION_SUFFIX
echo "VERSION=$VERSION" >> $GITHUB_ENV
export CMAKE_OPTS="${{ inputs.cmake_options }}"
echo "CMAKE_OPTS=$CMAKE_OPTS" >> $GITHUB_ENV
- name: Prepare workflow variables (historic)
if: inputs.node_type == 'historic'
run: |
[[ $BUILD_TYPE = "Debug" ]] && export VERSION_SUFFIX=debug || export VERSION_SUFFIX=release
export VERSION=${{ inputs.image_version }}-$VERSION_SUFFIX-historic
echo "VERSION=$VERSION" >> $GITHUB_ENV
export CMAKE_OPTS="-DHISTORIC_STATE=1 ${{ inputs.cmake_options }}"
echo "CMAKE_OPTS=$CMAKE_OPTS" >> $GITHUB_ENV
- name: update apt
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test || true
sudo apt-get update || true
- name: install packages
run: |

Check failure on line 61 in .github/workflows/setup-build-publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/setup-build-publish.yml

Invalid workflow file

You have an error in your yaml syntax on line 61
sudo apt-get -y remove libzmq* || true
sudo apt-get -y install software-properties-common gcc-9 g++-9 || true
sudo apt-get purge --auto-remove liblz4-dev || true
- name: Use g++-9 and gcov-9 by default
run: |
echo "Updating all needed alternatives"
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 9
sudo update-alternatives --install /usr/bin/gcov-dump gcov-dump /usr/bin/gcov-dump-9 9
sudo update-alternatives --install /usr/bin/gcov-tool gcov-tool /usr/bin/gcov-tool-9 9
echo "Checking alternative for gcc"
which gcc
gcc --version
echo "Checking alternative for g++"
which g++
g++ --version
echo "Checking alternative for gcov"
which gcov
gcov --version
echo "Checking alternative for gcov-dump"
which gcov-dump
gcov-dump --version
echo "Checking alternative for gcov-tool"
which gcov-tool
gcov-tool --version
- name: Extract repo name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ inputs.branch_name }}
- name: Submodule update
run: |
rm -rf ./libconsensus || true
ls -1
git submodule update --init --recursive
- name: Prepare ccache timestamp
id: ccache_cache_timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
message("::set-output name=timestamp::${current_date}")
- name: Ccache cache files
uses: actions/cache@v1.1.0
with:
path: .ccache
key: ${ { matrix.config.name } }-ccache-${ { steps.ccache_cache_timestamp.outputs.timestamp } }
restore-keys: |
${ { matrix.config.name } }-ccache-
- name: Build dependencies
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
[[ $CMAKE_BUILD_TYPE = "Debug" ]] && export DEBUG_FLAG=1 || export DEBUG_FLAG=0
cd deps
./clean.sh
rm -f ./libwebsockets-from-git.tar.gz
./build.sh PARALLEL_COUNT=$(nproc) DEBUG=$DEBUG_FLAG
cd ..
- name: Configure all
env:
CMAKE_OPTS: ${{ env.CMAKE_OPTS }}
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=$CMAKE_BUILD_TYPE $CMAKE_OPTS ..
cd ..
- name: Build all
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
export CMAKE_BUILD_TYPE=$BUILD_TYPE
cd build
make skaled -j$(nproc)
cd ..
- name: Build and publish container
env:
VERSION: ${{ env.VERSION }}
run: |
cp build/skaled/skaled scripts/skale_build/executable/
export BRANCH=${{ inputs.branch_name }}
export RELEASE=true
bash ./scripts/build_and_publish.sh
- name: Upload skaled binary as artifact
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: skaled-${{ inputs.node_type }}
path: ./build/skaled/skaled