Skip to content

Commit

Permalink
Merge bump-rhel-compatibility branch
Browse files Browse the repository at this point in the history
  • Loading branch information
clemahieu committed Jun 2, 2023
1 parent 4029cda commit fd07d15
Show file tree
Hide file tree
Showing 14 changed files with 113 additions and 282 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/beta_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,40 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2

linux_rpm_job:
if: ${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.result == 'success' && always() || github.event.inputs.ref != '' && always() }}
needs: build_auto_setup_job
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Sets the tag and repo variables (to build)
run: |
echo "TAG=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_tag || github.event.inputs.ref }}" >> $GITHUB_ENV
echo "VERSION_PRE_RELEASE=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_number || 'OFF' }}" >> $GITHUB_ENV
echo "REPO_TO_BUILD=${{ github.event.inputs.repo }}" >> $GITHUB_ENV
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: RockyLinux 8 Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
- name: Build Artifact
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -e BETA=1 -e TAG=$TAG -e REPO_TO_BUILD=$REPO_TO_BUILD -e RPM_RELEASE=1 \
-v ${GITHUB_WORKSPACE}:/workspace \
-v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
nanocurrency/nano-env:rhel /bin/bash -c "ci/build-rhel.sh"
- name: Deploy Artifacts
run: ci/actions/deploy.sh
env:
LINUX_RPM: 1
S3_BUILD_DIRECTORY: ${{ secrets.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2

linux_docker_job:
if: ${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.result == 'success' && always() || github.event.inputs.ref != '' && always() }}
needs: build_auto_setup_job
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/beta_artifacts_latest_release_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,39 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2

linux_rpm_job:
needs: build_auto_setup_job
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Sets the tag and repo variables (to build)
run: |
echo "TAG=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_tag || github.event.inputs.ref }}" >> $GITHUB_ENV
echo "VERSION_PRE_RELEASE=${{ github.event.inputs.ref == '' && needs.build_auto_setup_job.outputs.build_number || 'OFF' }}" >> $GITHUB_ENV
echo "REPO_TO_BUILD=${{ github.event.inputs.repo }}" >> $GITHUB_ENV
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
submodules: "recursive"
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: RockyLinux 8 Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
- name: Build Artifact
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -e BETA=1 -e TAG=$TAG -e REPO_TO_BUILD=$REPO_TO_BUILD -e RPM_RELEASE=1 \
-v ${GITHUB_WORKSPACE}:/workspace \
-v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
nanocurrency/nano-env:rhel /bin/bash -c "ci/build-rhel.sh"
- name: Deploy Artifacts
run: ci/actions/deploy.sh
env:
LINUX_RPM: 1
S3_BUILD_DIRECTORY: ${{ secrets.S3_BUILD_DIRECTORY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-2

linux_docker_job:
needs: build_auto_setup_job
runs-on: ubuntu-20.04
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/live_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
AWS_DEFAULT_REGION: us-east-2

linux_rpm_job:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Sets the tag and repo variables (to build)
Expand All @@ -77,15 +77,15 @@ jobs:
submodules: "recursive"
ref: ${{ github.ref }}
repository: ${{ github.repository }}
- name: CentOS Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-centos nanocurrency/nano-env:centos
- name: RockyLinux 8 Base
run: ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
- name: Build Artifact
run: |
mkdir -p ${GITHUB_WORKSPACE}/artifacts
docker run -e LIVE=1 -e TAG=$TAG -e REPO_TO_BUILD=$REPO_TO_BUILD -e RPM_RELEASE=1 \
-v ${GITHUB_WORKSPACE}:/workspace \
-v ${GITHUB_WORKSPACE}/artifacts:/root/rpmbuild \
nanocurrency/nano-env:centos /bin/bash -c "ci/build-centos.sh"
nanocurrency/nano-env:rhel /bin/bash -c "ci/build-rhel.sh"
- name: Deploy Artifacts
run: ci/actions/deploy.sh
env:
Expand Down
2 changes: 1 addition & 1 deletion ci/actions/linux/ghcr_push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if [[ "$GITHUB_WORKFLOW" = "Develop Branch Dockers Deploy" ]]; then
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:base"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:gcc"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:clang"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:centos"
"$scripts"/custom-timeout.sh 30 docker push "ghcr.io/${GITHUB_REPOSITORY}/nano-env:rhel"
else
tags=$(docker images --format '{{.Repository}}:{{.Tag }}' | grep "ghcr.io" | grep -vE "env|none")
for a in $tags; do
Expand Down
2 changes: 1 addition & 1 deletion ci/actions/linux/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if [[ "${COMPILER:-}" != "" ]]; then
else
ci/build-docker-image.sh docker/ci/Dockerfile-gcc nanocurrency/nano-env:gcc
ci/build-docker-image.sh docker/ci/Dockerfile-clang nanocurrency/nano-env:clang
ci/build-docker-image.sh docker/ci/Dockerfile-centos nanocurrency/nano-env:centos
ci/build-docker-image.sh docker/ci/Dockerfile-rhel nanocurrency/nano-env:rhel
fi

echo "Script ci/actions/linux/install_deps.sh finished"
9 changes: 6 additions & 3 deletions ci/build-centos.sh → ci/build-rhel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ run_build() {
mkdir -p ~/rpmbuild/SOURCES/
mv -f ~/nano-${VERSION}.tar.gz ~/rpmbuild/SOURCES/.
if [ "${LIVE:-}" == "1" ]; then
scl enable devtoolset-7 'rpmbuild -ba nanocurrency.spec'
else
scl enable devtoolset-7 'rpmbuild -ba nanocurrency-beta.spec'
scl enable gcc-toolset-12 'rpmbuild --nodebuginfo -ba nanocurrency.spec'
elif [ "${BETA:-}" == "1" ]; then
scl enable gcc-toolset-12 'rpmbuild -ba nanocurrency-beta.spec'
else
echo "Error: the node network was not defined."
exit 1
fi
}

Expand Down
8 changes: 0 additions & 8 deletions docker/ci/Dockerfile-centos

This file was deleted.

10 changes: 10 additions & 0 deletions docker/ci/Dockerfile-rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM rockylinux:8

WORKDIR /workspace

RUN yum update -y
RUN yum install -y git wget openssl bzip2
RUN yum install -y rpm-build
RUN yum install -y glibc-devel glibc-headers make which
RUN yum install -y cmake gcc-toolset-12
RUN yum install -y python38
15 changes: 6 additions & 9 deletions nanocurrency-beta.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: BSD-2-Clause
URL: https://nano.org/
Requires(pre): /usr/sbin/useradd, /usr/bin/getent
Requires(postun): /usr/sbin/userdel
BuildRequires: make, libstdc++-static, glibc-devel, glibc-headers
BuildRequires: make, glibc-devel, glibc-headers
Source: nano-%{version}.tar.gz

%description
Expand All @@ -17,22 +17,18 @@ the nano daemon, and a service.
%prep
if [ ! -x "$(which cmake)" ]; then
echo "cmake must exist, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
if cc --std=c++14 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
if cc --std=c++20 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
echo "Unsupported C++ compiler, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
exit 1
fi
if test ! -d /usr/local/boost; then
echo "Boost should be in /usr/local/boost" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
%autosetup -n nano-%{version}

%build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBOOST_ROOT=/usr/local/boost -DACTIVE_NETWORK=nano_beta_network .
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DACTIVE_NETWORK=nano_beta_network -DCMAKE_BUILD_TYPE=RelWithDebInfo .
make nano_node %{?_smp_mflags}
make nano_rpc %{?_smp_mflags}

Expand All @@ -43,6 +39,7 @@ mkdir -p %{buildroot}/etc/systemd/system/
cp nano_node %{buildroot}/usr/bin/nano_node-beta
cp nano_rpc %{buildroot}/usr/bin/nano_rpc-beta
cp etc/systemd/nanocurrency-beta.service %{buildroot}/etc/systemd/system/nanocurrency-beta.service
sed -i "s/nano_node/nano_node-beta/g" %{buildroot}/etc/systemd/system/nanocurrency-beta.service

%clean
if [ ! %{buildroot} = "/" ]; then %{__rm} -rf %{buildroot}; fi
Expand Down
14 changes: 5 additions & 9 deletions nanocurrency.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ License: BSD-2-Clause
URL: https://nano.org/
Requires(pre): /usr/sbin/useradd, /usr/bin/getent
Requires(postun): /usr/sbin/userdel
BuildRequires: make, libstdc++-static, glibc-devel, glibc-headers
BuildRequires: make, glibc-devel, glibc-headers
Source: nano-%{version}.tar.gz

%description
Expand All @@ -17,22 +17,18 @@ the nano daemon, and a service.
%prep
if [ ! -x "$(which cmake)" ]; then
echo "cmake must exist, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
if cc --std=c++14 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
if cc --std=c++20 --version 2>&1 >/dev/null | grep '^' >/dev/null; then
echo "Unsupported C++ compiler, try:" >&2
echo " scl enable devtoolset-7 'rpmbuild ...'" >&2
exit 1
fi
if test ! -d /usr/local/boost; then
echo "Boost should be in /usr/local/boost" >&2
echo " scl enable gcc-toolset-12 'rpmbuild ...'" >&2
exit 1
fi
%autosetup -n nano-%{version}

%build
cmake -DCMAKE_VERBOSE_MAKEFILE=ON -DBOOST_ROOT=/usr/local/boost .
cmake -DCMAKE_VERBOSE_MAKEFILE=ON .
make nano_node %{?_smp_mflags}
make nano_rpc %{?_smp_mflags}

Expand Down
47 changes: 0 additions & 47 deletions util/build_prep/centos/prep.sh.in

This file was deleted.

Loading

0 comments on commit fd07d15

Please # to comment.