Skip to content

Commit

Permalink
Merge pull request #1244 from Concordium/lma/release/github_actions
Browse files Browse the repository at this point in the history
Start github actions
  • Loading branch information
lassemand authored Nov 1, 2024
2 parents c85fbe7 + 6009450 commit 14a9427
Show file tree
Hide file tree
Showing 10 changed files with 663 additions and 100 deletions.
623 changes: 623 additions & 0 deletions .github/workflows/release.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion concordium-node/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion concordium-node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "concordium_node"
version = "7.0.5" # must be kept in sync with 'is_compatible_version' in 'src/configuration.rs'
version = "7.0.6" # must be kept in sync with 'is_compatible_version' in 'src/configuration.rs'
description = "Concordium Node"
authors = ["Concordium <[email protected]>"]
exclude = [".gitignore", ".gitlab-ci.yml", "test/**/*","**/**/.gitignore","**/**/.gitlab-ci.yml"]
Expand Down
25 changes: 0 additions & 25 deletions scripts/database-exporter/Dockerfile

This file was deleted.

53 changes: 0 additions & 53 deletions scripts/database-exporter/publish.sh

This file was deleted.

4 changes: 2 additions & 2 deletions scripts/distribution/macOS-package/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ function compileConsensus() {
function compileNodeAndCollector() {
cd "$nodeDir"
logInfo "Building Node and Collector..."
cargo build --bin concordium-node --release
cargo build --bin concordium-node --release --locked
cd "$collectorDir"
cargo build --release
cargo build --release --locked
logInfo "Done"
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/distribution/windows/build-all.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ stack build
if ($LASTEXITCODE -ne 0) { throw "Failed building consensus" }

Write-Output "Building node..."
stack exec -- cargo build --manifest-path concordium-node\Cargo.toml --release
stack exec -- cargo build --manifest-path concordium-node\Cargo.toml --release --locked
if ($LASTEXITCODE -ne 0) { throw "Failed building node" }

Write-Output "Building the collector..."
cargo +$rustVersion-x86_64-pc-windows-msvc build --manifest-path collector\Cargo.toml --release
cargo +$rustVersion-x86_64-pc-windows-msvc build --manifest-path collector\Cargo.toml --release --locked
if ($LASTEXITCODE -ne 0) { throw "Failed building the collector" }

Write-Output "Building node runner service..."
Expand All @@ -26,7 +26,7 @@ Write-Output "Building node runner service..."
# This ensures that the MSVC runtime is linked statically, and the output is produced
# in the right target folder.
Push-Location service\windows
cargo +$rustVersion-x86_64-pc-windows-msvc build --release
cargo +$rustVersion-x86_64-pc-windows-msvc build --release --locked
Pop-Location
if ($LASTEXITCODE -ne 0) { throw "Failed building node runner service" }

Expand Down
31 changes: 21 additions & 10 deletions scripts/static-binaries/build-on-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,23 @@ set -euxo pipefail

extra_features=${EXTRA_FEATURES:-""}

protoc_version=3.15.3
flatbuffers_version=v22.10.26
rust_toolchain_version=1.73
REQUIRED_PARAMETERS=("PROTOC_VERSION" "FLATBUFFERS_VERSION" "RUST_TOOLCHAIN_VERSION")

# Loop through the required variables and check if they are set
for VAR in "${REQUIRED_PARAMETERS[@]}"; do
if [ -z "${!VAR}" ]; then
echo "Error: $VAR is not set or empty."
exit 1
fi
done

# Install dependencies.

apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get -y install \
git \
curl \
libprotobuf-dev \
libssl-dev \
cmake \
pkg-config \
libnuma-dev \
libgmp-dev \
Expand All @@ -37,7 +41,7 @@ DEBIAN_FRONTEND=noninteractive apt-get -y install \

# Install protobuf

curl -L https://github.com/protocolbuffers/protobuf/releases/download/v${protoc_version}/protoc-${protoc_version}-linux-x86_64.zip -o protoc.zip
curl -L "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip" -o protoc.zip
unzip protoc.zip bin/protoc -d /usr/
rm protoc.zip

Expand All @@ -46,12 +50,19 @@ rm protoc.zip
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
rustup set profile minimal
rustup default "$rust_toolchain_version"
rustup default "$RUST_TOOLCHAIN_VERSION"

# Install flatbuffers.
ASSETS_URL="https://github.com/google/flatbuffers/releases/expanded_assets/v${FLATBUFFERS_VERSION}"
GCC_VERSION=$(curl -s "$ASSETS_URL" | grep -oP 'Linux\.flatc\.binary\.g\+\+\-\K[0-9]+' | head -n 1)
if [ -z "$GCC_VERSION" ]; then
echo "Could not determine GCC version."
exit 1
else
echo "Derived GCC version: $GCC_VERSION"
fi

git clone https://github.com/google/flatbuffers.git
( cd flatbuffers && git checkout "$flatbuffers_version" && cmake -G "Unix Makefiles" && make -j"$(nproc)" && make install )
curl -L "https://github.com/google/flatbuffers/releases/download/v${FLATBUFFERS_VERSION}/Linux.flatc.binary.g++-${GCC_VERSION}.zip" -O
unzip "Linux.flatc.binary.g++-${GCC_VERSION}.zip" -d /usr/bin

# Build all the binaries and copy them to ./bin/
# This requires an up-to-date lockfile which should be committed to the repository.
Expand Down
15 changes: 11 additions & 4 deletions scripts/static-binaries/static-binaries.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ ARG ubuntu_version
ARG static_libraries_image_tag

# Build static consensus libraries.
FROM concordium/static-libraries:$static_libraries_image_tag as static-builder
FROM concordium/static-libraries:${static_libraries_image_tag} as static-builder
COPY . /build
ARG ghc_version
WORKDIR /build
RUN GHC_VERSION="$ghc_version" \
/build/scripts/static-libraries/build-static-libraries.sh

# Build static node binaries.
FROM ubuntu:$ubuntu_version
FROM ubuntu:${ubuntu_version}

COPY scripts/static-binaries/build-on-ubuntu.sh /build-on-ubuntu.sh
COPY . /build
Expand All @@ -27,9 +27,16 @@ RUN tar -C /tmp -xf /tmp/static-consensus.tar.gz && \
# Build (mostly) static node and some auxiliary binaries
ARG build_version
ARG extra_features
ARG protoc_version
ARG flatbuffers_version
ARG rust_toolchain_version

WORKDIR /build
RUN BRANCH="$branch" \
EXTRA_FEATURES="$extra_features" \
RUN BRANCH="${branch}" \
EXTRA_FEATURES="${extra_features}" \
PROTOC_VERSION="${protoc_version}" \
FLATBUFFERS_VERSION="${flatbuffers_version}" \
RUST_TOOLCHAIN_VERSION="${rust_toolchain_version}" \
/build-on-ubuntu.sh

# The binaries are available in the
Expand Down
2 changes: 1 addition & 1 deletion service/windows/installer/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ try {
# Build the custom actions DLL. This provides custom functionality used by the installer.
Write-Output "Building custom-actions.dll..."
Push-Location custom-actions
cargo +$toolchain build --release
cargo +$toolchain build --release --locked
Pop-Location
if ($LASTEXITCODE -ne 0) { throw "Failed building custom-actions.dll" }

Expand Down

0 comments on commit 14a9427

Please sign in to comment.