From d74c232532c27efa74713814950b91150cea9349 Mon Sep 17 00:00:00 2001 From: Daniel Jones Date: Fri, 20 Sep 2024 13:11:29 -0500 Subject: [PATCH] Adding rpm packagers --- .../workflows/rpm_amoy_profile_packager.yml | 323 ++++++++++++++++++ .github/workflows/rpm_arm_packager.yml | 95 ++++++ .../rpm_mainnet_profile_packager.yml | 321 +++++++++++++++++ .github/workflows/rpm_packager.yml | 94 +++++ 4 files changed, 833 insertions(+) create mode 100644 .github/workflows/rpm_amoy_profile_packager.yml create mode 100644 .github/workflows/rpm_arm_packager.yml create mode 100644 .github/workflows/rpm_mainnet_profile_packager.yml create mode 100644 .github/workflows/rpm_packager.yml diff --git a/.github/workflows/rpm_amoy_profile_packager.yml b/.github/workflows/rpm_amoy_profile_packager.yml new file mode 100644 index 0000000000..7fa6db8f7a --- /dev/null +++ b/.github/workflows/rpm_amoy_profile_packager.yml @@ -0,0 +1,323 @@ +name: rpm_amoy_profile + +on: + push: + branches: + - 'main' + paths: + - '**' + tags: + - 'v*.*.*' + - 'v*.*.*-*' + +jobs: + build: + permissions: + id-token: write + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Adding TAG to ENV + run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV + + - name: Adding a TAG1 to the env + run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV + + - name: Installing some dependencies + run: sudo apt-get update && sudo apt-get install -y rpm + + - name: Setup rpm package directories + run: | + mkdir -p packaging/rpm/SPECS + mkdir -p packaging/rpm/BUILD + mkdir -p packaging/rpm/RPMS + mkdir -p packaging/rpm/SRPMS + + - name: Start tasks needed for Amoy Sentry node + run: echo "#########################################################################" + + - name: Setting up Amoy Sentry Node Spec files + run: | + touch packaging/rpm/bor-amoy-sentry.spec + echo "Name: bor-amoy-sentry-config" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "Summary: bor amoy sentry config rpm package" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + + echo "%description" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "Bor Amoy Sentry rpm package" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + + echo "" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "%pre" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "%install" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/testnet-amoy/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + + echo "%files" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "%post" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-sentry.spec + + - name: Build Amoy Sentry Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-amoy-sentry.spec + + - name: Start tasks needed for Amoy Sentry PBSS node + run: echo "#########################################################################" + + - name: Setting up Amoy Sentry PBSS Node Spec files + run: | + touch packaging/rpm/bor-amoy-sentry-pbss.spec + echo "Name: bor-amoy-sentry-pbss-config" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "Summary: bor amoy sentry config rpm package" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + + echo "%description" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "Bor Amoy Sentry rpm package" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + + echo "" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "%pre" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "%install" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/testnet-amoy/sentry/sentry/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + + echo "%files" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "%post" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + + - name: Build Amoy Sentry PBSS Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-amoy-sentry-pbss.spec + + - name: Setting up Amoy Validator Node node + run: echo "#########################################################################" + + - name: Setting up Amoy Validator Node Spec files + run: | + touch packaging/rpm/bor-amoy-validator.spec + echo "Name: bor-amoy-validator-config" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "Summary: bor amoy validator config rpm package" >> packaging/rpm/SPECS/bor-amoy-validator.spec + + echo "%description" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "Bor Amoy Validator rpm package" >> packaging/rpm/SPECS/bor-amoy-validator.spec + + echo "" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "%pre" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "%install" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/testnet-amoy/sentry/validator/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-validator.spec + + echo "%files" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "%post" >> packaging/rpm/SPECS/bor-amoy-validator.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-validator.spec + + + - name: Build Amoy Validator Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-amoy-validator.spec + + - name: Setting up Amoy Validator PBSS Node node + run: echo "#########################################################################" + + - name: Setting up Amoy Validator PBSS Node Spec files + run: | + touch packaging/rpm/bor-amoy-validator-pbss.spec + echo "Name: bor-amoy-validator-pbss-config" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "Summary: bor amoy validator config rpm package" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + + echo "%description" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "Bor Amoy Validator rpm package" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + + echo "" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "%pre" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "%install" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/testnet-amoy/sentry/validator/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + + echo "%files" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "%post" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + + + - name: Build Amoy Validator PBSS Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-amoy-validator-pbss.spec + + + - name: Setting up Amoy Boot node + run: echo "#########################################################################" + + - name: Setting up Amoy Boot Node Spec files + run: | + touch packaging/rpm/bor-amoy-bootnode.spec + echo "Name: bor-amoy-bootnode-config" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "Summary: bor amoy bootnode config rpm package" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + + echo "%description" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "Bor Amoy Bootnode rpm package" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + + echo "" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "%pre" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "%install" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/testnet-amoy/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor_bootnode.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + + echo "%files" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "%post" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-bootnode.spec + + - name: Build Amoy Boot Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-amoy-bootnode.spec + + - name: Setting up Amoy Archive node + run: echo "#########################################################################" + + - name: Setting up Amoy Archive Node spec file + run: | + touch packaging/rpm/bor-amoy-archive.spec + echo "Name: bor-amoy-archive-config" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "Summary: bor amoy archive config rpm package" >> packaging/rpm/SPECS/bor-amoy-archive.spec + + echo "%description" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "Bor Amoy Archive rpm package" >> packaging/rpm/SPECS/bor-amoy-archive.spec + + echo "" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "%pre" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "%install" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/testnet-amoy/archive/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-archive.spec + + echo "%files" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "%post" >> packaging/rpm/SPECS/bor-amoy-archive.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-amoy-archive.spec + + - name: Build Amoy Archive Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-amoy-archive.spec + + - name: renaming file for rpm release appendage archive amoy + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-archive-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage bootnode amoy + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage sentry amoy + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage sentry pbss amoy + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-pbss-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage validator amoy + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage validator pbss amoy + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-pbss-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm + + - name: adding shasum for the rpm build amoy archive + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build amoy bootnode + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build amoy sentry + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build amoy sentry pbss + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-sentry-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-sentry-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build amoy validator + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build amoy validator pbss + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-amoy-validator-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-amoy-validator-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + + + - name: Release bor Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/noarch/bor-amoy-**.rpm + packaging/rpm_build/RPMS/noarch/bor-amoy-**.rpm.checksum \ No newline at end of file diff --git a/.github/workflows/rpm_arm_packager.yml b/.github/workflows/rpm_arm_packager.yml new file mode 100644 index 0000000000..d86cc32740 --- /dev/null +++ b/.github/workflows/rpm_arm_packager.yml @@ -0,0 +1,95 @@ +name: package_arm_rpm + +on: + push: + branches: + - 'main' + paths: + - '**' + tags: + - 'v*.*.*' + - 'v*.*.*-*' + +jobs: + build: + permissions: + id-token: write + contents: write + runs-on: + labels: arm-runner-2204 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@master + with: + go-version: 1.22.1 + - name: Adding TAG to ENV + run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV + + - name: Adding a TAG1 to the env + run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV + + - name: Cleaning repo + run: make clean + - name: Building for arm64 + run: make bor + + - name: Installing some dependencies + run: sudo apt-get update && sudo apt-get install -y rpm + + - name: Setup rpm package for binary + run: | + mkdir -p packaging/rpm/SPECS + mkdir -p packaging/rpm/BUILD + mkdir -p packaging/rpm/RPMS + mkdir -p packaging/rpm/SRPMS + + touch packaging/rpm/bor.spec + echo "Name: bor" >> packaging/rpm/SPECS/bor.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor.spec + echo "BuildArch: aarch64" >> packaging/rpm/SPECS/bor.spec + echo "Summary: bor rpm package" >> packaging/rpm/SPECS/bor.spec + + echo "%description" >> packaging/rpm/SPECS/bor.spec + echo "Bor rpm package" >> packaging/rpm/SPECS/bor.spec + + echo "%pre" >> packaging/rpm/SPECS/bor.spec + echo "getent group bor >/dev/null || groupadd -r bor" >> packaging/rpm/SPECS/bor.spec + echo "getent passwd bor >/dev/null || useradd -s /bin/false -d /var/lib/bor -r bor -g bor" >> packaging/rpm/SPECS/bor.spec + + echo "%install" >> packaging/rpm/SPECS/bor.spec + echo "mkdir -p %{buildroot}/usr/bin" >> packaging/rpm/SPECS/bor.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/build/bin/bor %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/bor.spec + + echo "%files" >> packaging/rpm/SPECS/bor.spec + echo "/usr/bin/bor" >> packaging/rpm/SPECS/bor.spec + + + - name: construct rpm package + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor.spec + + - name: rename file for post rpm build and for checksum + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}-1.aarch64.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}.aarch64.rpm + + - name: checksum for the rpm package + run: sha256sum /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}.aarch64.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/aarch64/bor-${{ env.GIT_TAG1 }}.aarch64.rpm.checksum + + - name: Release bor Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/aarch64/bor-**.rpm + packaging/rpm_build/RPMS/aarch64/bor-**.rpm.checksum diff --git a/.github/workflows/rpm_mainnet_profile_packager.yml b/.github/workflows/rpm_mainnet_profile_packager.yml new file mode 100644 index 0000000000..49c06345d0 --- /dev/null +++ b/.github/workflows/rpm_mainnet_profile_packager.yml @@ -0,0 +1,321 @@ +name: rpm_mainnet_profile + +on: + push: + branches: + - 'main' + paths: + - '**' + tags: + - 'v*.*.*' + - 'v*.*.*-*' + +jobs: + build: + permissions: + id-token: write + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Adding TAG to ENV + run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV + + - name: Adding a TAG1 to the env + run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV + + - name: Installing some dependencies + run: sudo apt-get update && sudo apt-get install -y rpm + + - name: Setup rpm package directories + run: | + mkdir -p packaging/rpm/SPECS + mkdir -p packaging/rpm/BUILD + mkdir -p packaging/rpm/RPMS + mkdir -p packaging/rpm/SRPMS + + - name: Start tasks needed for Mainnet Sentry node + run: echo "#########################################################################" + + - name: Setting up Mainnet Sentry Node Spec files + run: | + touch packaging/rpm/bor-mainnet-sentry.spec + echo "Name: bor-mainnet-sentry-config" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "Summary: bor mainnet sentry config rpm package" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + + echo "%description" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "Bor Mumbai Sentry rpm package" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + + echo "" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "%install" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + + echo "%files" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "%post" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-sentry.spec + + - name: Build Mainnet Sentry Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-mainnet-sentry.spec + + - name: Start tasks needed for Mainnet Sentry PBSS node + run: echo "#########################################################################" + + - name: Setting up Mainnet Sentry PBSS Node Spec files + run: | + touch packaging/rpm/bor-mainnet-sentry-pbss.spec + echo "Name: bor-mainnet-sentry-pbss-config" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "Summary: bor mainnet sentry config rpm package" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + + echo "%description" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "Bor Mumbai Sentry rpm package" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + + echo "" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "%install" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/mainnet-v1/sentry/sentry/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + + echo "%files" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "%post" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + + - name: Build Mainnet Sentry PBSS Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-mainnet-sentry-pbss.spec + + - name: Setting up Mainnet Validator Node node + run: echo "#########################################################################" + + - name: Setting up Mainnet Validator Node Spec files + run: | + touch packaging/rpm/bor-mainnet-validator.spec + echo "Name: bor-mainnet-validator-config" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "Summary: bor mainnet validator config rpm package" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + + echo "%description" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "Bor Mainnet Validator rpm package" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + + echo "" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "%install" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/mainnet-v1/sentry/validator/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + + echo "%files" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "%post" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-validator.spec + + + - name: Build Mainnet Validator Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-mainnet-validator.spec + + - name: Setting up Mainnet Validator PBSS Node node + run: echo "#########################################################################" + + - name: Setting up Mainnet Validator Node Spec files + run: | + touch packaging/rpm/bor-mainnet-validator-pbss.spec + echo "Name: bor-mainnet-validator-pbss-config" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "Summary: bor mainnet validator config rpm package" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + + echo "%description" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "Bor Mainnet Validator rpm package" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + + echo "" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "%install" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/mainnet-v1/sentry/validator/bor/pbss_config.toml %{buildroot}/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + + echo "%files" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "%post" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + + + - name: Build Mainnet Validator PBSS Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-mainnet-validator-pbss.spec + + - name: Setting up Mainnet Boot node + run: echo "#########################################################################" + + - name: Setting up Mainnet Boot Node Spec files + run: | + touch packaging/rpm/bor-mainnet-bootnode.spec + echo "Name: bor-mainnet-bootnode-config" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "Summary: bor mainnet bootnode config rpm package" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + + echo "%description" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "Bor Mainnet Bootnode rpm package" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + + echo "" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "%install" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/mainnet-v1/sentry/sentry/bor/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor_bootnode.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + + echo "%files" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "%post" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-bootnode.spec + + - name: Build Mainnet Boot Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-mainnet-bootnode.spec + + - name: Setting up Mainnet Archive node + run: echo "#########################################################################" + + - name: Setting up Mainnet Archive Node spec file + run: | + touch packaging/rpm/bor-mainnet-archive.spec + echo "Name: bor-mainnet-archive-config" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "Summary: bor mainnet archive config rpm package" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + + echo "%description" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "Bor Mainnet Archive rpm package" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + + echo "" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "%pre" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "%install" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "mkdir -p %{buildroot}/var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/mainnet-v1/archive/config.toml %{buildroot}/var/lib/bor/" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/packaging/templates/systemd/bor.service %{buildroot}/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + + echo "%files" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "/var/lib/bor/config.toml" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "/lib/systemd/system/bor.service" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "%attr(0755, bor, bor) /var/lib/bor" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "%post" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/bor-mainnet-archive.spec + + - name: Build Mainnet Archive Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor-mainnet-archive.spec + + - name: renaming file for rpm release appendage archive mainnet + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-archive-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage bootnode mainnet + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage sentry mainnet + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage sentry pbss mainnet + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-pbss-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage validator mainnet + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: renaming file for rpm release appendage validator pbss mainnet + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-pbss-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm + + - name: adding shasum for the rpm build mainnet archive + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-archive-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build mainnet bootnode + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-bootnode-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build mainnet sentry + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build mainnet sentry pbss + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-sentry-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-sentry-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build mainnet validator + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: adding shasum for the rpm build mainnet pbss validator + run: cd /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/ && sha256sum bor-mainnet-validator-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/noarch/bor-mainnet-validator-pbss-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + + - name: Release bor Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/noarch/bor-mainnet-**.rpm + packaging/rpm_build/RPMS/noarch/bor-mainnet-**.rpm.checksum diff --git a/.github/workflows/rpm_packager.yml b/.github/workflows/rpm_packager.yml new file mode 100644 index 0000000000..cac9cfe0bc --- /dev/null +++ b/.github/workflows/rpm_packager.yml @@ -0,0 +1,94 @@ +name: package_x86_rpm + +on: + push: + branches: + - 'main' + paths: + - '**' + tags: + - 'v*.*.*' + - 'v*.*.*-*' + +jobs: + build: + permissions: + id-token: write + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@master + with: + go-version: 1.22.1 + - name: Adding TAG to ENV + run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV + + - name: Adding a TAG.1 to the env + run: echo "GIT_TAG1=`echo $(git describe --tags --abbrev=0)`" | sed 's/-/./g' >> $GITHUB_ENV + + - name: Cleaning repo + run: make clean + - name: Building for amd64 + run: make bor + + - name: Installing some dependencies + run: sudo apt-get update && sudo apt-get install -y rpm + + - name: Setup rpm package for binary + run: | + mkdir -p packaging/rpm/SPECS + mkdir -p packaging/rpm/BUILD + mkdir -p packaging/rpm/RPMS + mkdir -p packaging/rpm/SRPMS + + touch packaging/rpm/bor.spec + echo "Name: bor" >> packaging/rpm/SPECS/bor.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/bor.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/bor.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/bor.spec + echo "BuildArch: x86_64" >> packaging/rpm/SPECS/bor.spec + echo "Summary: bor rpm package" >> packaging/rpm/SPECS/bor.spec + + echo "%description" >> packaging/rpm/SPECS/bor.spec + echo "Bor rpm package" >> packaging/rpm/SPECS/bor.spec + + echo "%pre" >> packaging/rpm/SPECS/bor.spec + echo "getent group bor >/dev/null || groupadd -r bor" >> packaging/rpm/SPECS/bor.spec + echo "getent passwd bor >/dev/null || useradd -s /bin/false -d /var/lib/bor -r bor -g bor" >> packaging/rpm/SPECS/bor.spec + + echo "%install" >> packaging/rpm/SPECS/bor.spec + echo "mkdir -p %{buildroot}/usr/bin" >> packaging/rpm/SPECS/bor.spec + echo "cp /home/runner/work/bor-dontuse/bor-dontuse/build/bin/bor %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/bor.spec + + echo "%files" >> packaging/rpm/SPECS/bor.spec + echo "/usr/bin/bor" >> packaging/rpm/SPECS/bor.spec + + + - name: construct rpm package + run: | + rpmbuild --define "_topdir /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build" \ + --define "_builddir %{_topdir}/BUILD" \ + --define "_rpmdir %{_topdir}/RPMS" \ + --define "_srcrpmdir %{_topdir}/SRPMS" \ + --define "__spec_install_post /bin/true" \ + -bb packaging/rpm/SPECS/bor.spec + + - name: rename file for post rpm build and for checksum + run: mv /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}-1.x86_64.rpm /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}.x86_64.rpm + + - name: checksum for the rpm package + run: sha256sum /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}.x86_64.rpm > /home/runner/work/bor-dontuse/bor-dontuse/packaging/rpm_build/RPMS/x86_64/bor-${{ env.GIT_TAG1 }}.x86_64.rpm.checksum + + - name: Release bor Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/x86_64/bor-**.rpm + packaging/rpm_build/RPMS/x86_64/bor-**.rpm.checksum