diff --git a/.github/workflows/rpm_amoy_profiles.yml b/.github/workflows/rpm_amoy_profiles.yml new file mode 100644 index 000000000..517968ec0 --- /dev/null +++ b/.github/workflows/rpm_amoy_profiles.yml @@ -0,0 +1,142 @@ +name: packager_amoy_rpm_profiles + +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 TAG1 to 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: echo some tags + run: echo ${{ env.GIT_TAG1 }} and ${{ env.GIT_TAG }} + + - 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/heimdall-amoy-sentry.spec + echo "Name: heimdall-amoy-sentry-config" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "Summary: heimdall amoy sentry config rpm package" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + + echo "%description" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "heimdall amoy Sentry rpm package" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + + echo "" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "%pre" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "sudo -u heimdall heimdalld init --chain=amoy --home /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "%install" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "mkdir -p %{buildroot}/var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/templates/systemd/heimdalld-amoy-sentry.service %{buildroot}/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + + echo "%files" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + + echo "%attr(0755, heimdall, heimdall) /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "%post" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec + + - name: Build Amoy Sentry Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/heimdall-dontuse/heimdall-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/heimdall-amoy-sentry.spec + + - name: Setting up Amoy Validator Node node + run: echo "#########################################################################" + + - name: Setting up Amoy Validator Node Spec files + run: | + touch packaging/rpm/heimdall-amoy-validator.spec + echo "Name: heimdall-amoy-validator-config" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "Summary: heimdall Amoy validator config rpm package" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + + echo "%description" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "heimdall amoy Validator rpm package" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + + echo "" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "%pre" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "sudo -u heimdall heimdalld init --chain=amoy --home /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "%install" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "mkdir -p %{buildroot}/var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/templates/systemd/heimdalld-amoy-validator.service %{buildroot}/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + + echo "%files" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + + echo "%attr(0755, heimdall, heimdall) /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "%post" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/heimdall-amoy-validator.spec + + - name: Build Amoy Validator Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/heimdall-dontuse/heimdall-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/heimdall-amoy-validator.spec + + - name: rename packages due to rpm dist rules amoy validator + run: mv /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: rename packages due to rpm dist rules amoy sentry + run: mv /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm + + - name: shasum a package amoy validator + run: shasum /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: shasum a package amoy sentry + run: shasum /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-amoy-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + + - name: Release heimdall Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/noarch/heimdall-amoy**.rpm + packaging/rpm_build/RPMS/noarch/heimdall-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 000000000..851b73c45 --- /dev/null +++ b/.github/workflows/rpm_arm_packager.yml @@ -0,0 +1,97 @@ +name: packager_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.x + - name: Adding TAG to ENV + run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV + - name: Adding TAG1 to 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 build + + - name: Installing some dependencies + run: sudo apt-get update && sudo apt-get install -y rpm + + - name: Setup rpm package for binary aarch64 + run: | + mkdir -p packaging/rpm/SPECS + mkdir -p packaging/rpm/BUILD + mkdir -p packaging/rpm/RPMS + mkdir -p packaging/rpm/SRPMS + + touch packaging/rpm/heimdall.spec + echo "Name: heimdall" >> packaging/rpm/SPECS/heimdall.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/heimdall.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/heimdall.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/heimdall.spec + echo "BuildArch: aarch64" >> packaging/rpm/SPECS/heimdall.spec + echo "Summary: heimdall rpm package" >> packaging/rpm/SPECS/heimdall.spec + + echo "%description" >> packaging/rpm/SPECS/heimdall.spec + echo "heimdall rpm package" >> packaging/rpm/SPECS/heimdall.spec + + echo "%pre" >> packaging/rpm/SPECS/heimdall.spec + echo "getent group heimdall >/dev/null || groupadd -r heimdall" >> packaging/rpm/SPECS/heimdall.spec + echo "getent passwd heimdall >/dev/null || useradd -s /bin/false -d /var/lib/heimdall -r heimdall -g heimdall" >> packaging/rpm/SPECS/heimdall.spec + + echo "%install" >> packaging/rpm/SPECS/heimdall.spec + echo "mkdir -p %{buildroot}/usr/bin" >> packaging/rpm/SPECS/heimdall.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/build/heimdalld %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/heimdall.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/build/heimdallcli %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/heimdall.spec + + echo "%files" >> packaging/rpm/SPECS/heimdall.spec + + echo "/usr/bin/heimdalld" >> packaging/rpm/SPECS/heimdall.spec + echo "/usr/bin/heimdallcli" >> packaging/rpm/SPECS/heimdall.spec + + - name: construct rpm package + run: | + rpmbuild --define "_topdir /home/runner/work/heimdall-dontuse/heimdall-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/heimdall.spec + + + - name: rename packages due to rpm dist rules + run: mv /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/aarch64/heimdall-${{ env.GIT_TAG1 }}-1.aarch64.rpm /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/aarch64/heimdall-${{ env.GIT_TAG1 }}.aarch64.rpm + + - name: shasum a package + run: shasum /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/aarch64/heimdall-${{ env.GIT_TAG1 }}.aarch64.rpm > /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/aarch64/heimdall-${{ env.GIT_TAG1 }}.aarch64.rpm.checksum + + - name: Release heimdall Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/aarch64/heimdall-**.rpm + packaging/rpm_build/RPMS/aarch64/heimdall-**.rpm.checksum \ No newline at end of file diff --git a/.github/workflows/rpm_mainnet_profiles.yml b/.github/workflows/rpm_mainnet_profiles.yml new file mode 100644 index 000000000..281986ed1 --- /dev/null +++ b/.github/workflows/rpm_mainnet_profiles.yml @@ -0,0 +1,147 @@ +name: packager_mainnet_rpm_profiles + +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 TAG1 to 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: echo some tags + run: echo ${{ env.GIT_TAG1 }} and ${{ env.GIT_TAG }} + + - 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: Starting Mainnet Builds + run: echo "##########################################################################" + + - name: Start tasks needed for Mainnet Sentry node + run: echo "#########################################################################" + + - name: Setting up Mainnet Sentry Node Spec files + run: | + touch packaging/rpm/heimdall-mainnet-sentry.spec + echo "Name: heimdall-mainnet-sentry-config" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "Release: 1" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "Summary: heimdall mainnet sentry config rpm package" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + + echo "%description" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "heimdall Mainnet Sentry rpm package" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + + echo "" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "%pre" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "sudo -u heimdall heimdalld init --chain=mainnet --home /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "%install" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "mkdir -p %{buildroot}/var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/templates/systemd/heimdalld-mainnet-sentry.service %{buildroot}/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + + echo "%files" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + + echo "%attr(0755, heimdall, heimdall) /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "%post" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec + + - name: Build Mainnet Sentry Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/heimdall-dontuse/heimdall-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/heimdall-mainnet-sentry.spec + + - name: Setting up Mainnet Validator Node node + run: echo "#########################################################################" + + - name: Setting up Mainnet Validator Node Spec files + run: | + touch packaging/rpm/heimdall-mainnet-validator.spec + echo "Name: heimdall-mainnet-validator-config" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "BuildArch: noarch" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "Summary: heimdall mainnet validator config rpm package" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + + echo "%description" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "heimdall Mainnet Validator rpm package" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + + echo "" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "%pre" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "sudo -u heimdall heimdalld init --chain=mainnet --home /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "%install" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "mkdir -p %{buildroot}/var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "mkdir -p %{buildroot}/lib/systemd/system" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/templates/systemd/heimdalld-mainnet-validator.service %{buildroot}/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + + echo "%files" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + + echo "%attr(0755, heimdall, heimdall) /var/lib/heimdall" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "%post" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + echo "/bin/systemctl daemon-reload" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec + + + - name: Build Mainnet Validator Node profile RPM + run: | + rpmbuild --define "_topdir /home/runner/work/heimdall-dontuse/heimdall-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/heimdall-mainnet-validator.spec + + + - name: rename packages due to rpm dist rules mainnet validator + run: mv /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm + - name: rename packages due to rpm dist rules mainnet sentry + run: mv /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm + + - name: shasum a package mainnet validator + run: shasum /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + - name: shasum a package mainnet sentry + run: shasum /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm.checksum + + - name: Release heimdall Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/noarch/heimdall-mainnet**.rpm + packaging/rpm_build/RPMS/noarch/heimdall-mainnet**.rpm.checksum diff --git a/.github/workflows/rpm_packager.yml b/.github/workflows/rpm_packager.yml new file mode 100644 index 000000000..d7a0c8f02 --- /dev/null +++ b/.github/workflows/rpm_packager.yml @@ -0,0 +1,96 @@ +name: packager_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.x + - name: Adding TAG to ENV + run: echo "GIT_TAG=`echo $(git describe --tags --abbrev=0)`" >> $GITHUB_ENV + - name: Adding TAG1 to 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 build + + - name: Installing some dependencies + run: sudo apt-get update && sudo apt-get install -y rpm + + - name: Setup rpm package for binary x86_64 + run: | + mkdir -p packaging/rpm/SPECS + mkdir -p packaging/rpm/BUILD + mkdir -p packaging/rpm/RPMS + mkdir -p packaging/rpm/SRPMS + + touch packaging/rpm/heimdall.spec + echo "Name: heimdall" >> packaging/rpm/SPECS/heimdall.spec + echo "Version: ${{ env.GIT_TAG1 }}" >> packaging/rpm/SPECS/heimdall.spec + echo "Release: 1%{?dist}" >> packaging/rpm/SPECS/heimdall.spec + echo "License: GPL/AGPL" >> packaging/rpm/SPECS/heimdall.spec + echo "BuildArch: x86_64" >> packaging/rpm/SPECS/heimdall.spec + echo "Summary: heimdall rpm package" >> packaging/rpm/SPECS/heimdall.spec + + echo "%description" >> packaging/rpm/SPECS/heimdall.spec + echo "heimdall rpm package" >> packaging/rpm/SPECS/heimdall.spec + + echo "%pre" >> packaging/rpm/SPECS/heimdall.spec + echo "getent group heimdall >/dev/null || groupadd -r heimdall" >> packaging/rpm/SPECS/heimdall.spec + echo "getent passwd heimdall >/dev/null || useradd -s /bin/false -d /var/lib/heimdall -r heimdall -g heimdall" >> packaging/rpm/SPECS/heimdall.spec + + echo "%install" >> packaging/rpm/SPECS/heimdall.spec + echo "mkdir -p %{buildroot}/usr/bin" >> packaging/rpm/SPECS/heimdall.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/build/heimdalld %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/heimdall.spec + echo "cp /home/runner/work/heimdall-dontuse/heimdall-dontuse/build/heimdallcli %{buildroot}/usr/bin/" >> packaging/rpm/SPECS/heimdall.spec + + echo "%files" >> packaging/rpm/SPECS/heimdall.spec + + echo "/usr/bin/heimdalld" >> packaging/rpm/SPECS/heimdall.spec + echo "/usr/bin/heimdallcli" >> packaging/rpm/SPECS/heimdall.spec + + - name: construct rpm package + run: | + rpmbuild --define "_topdir /home/runner/work/heimdall-dontuse/heimdall-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/heimdall.spec + + + - name: rename packages due to rpm dist rules + run: mv /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/x86_64/heimdall-${{ env.GIT_TAG1 }}-1.x86_64.rpm /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/x86_64/heimdall-${{ env.GIT_TAG1 }}.x86_64.rpm + + - name: shasum a package + run: shasum /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/x86_64/heimdall-${{ env.GIT_TAG1 }}.x86_64.rpm > /home/runner/work/heimdall-dontuse/heimdall-dontuse/packaging/rpm_build/RPMS/x86_64/heimdall-${{ env.GIT_TAG1 }}.x86_64.rpm.checksum + + - name: Release heimdall Packages + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ env.GIT_TAG }} + prerelease: true + files: | + packaging/rpm_build/RPMS/x86_64/heimdall-**.rpm + packaging/rpm_build/RPMS/x86_64/heimdall-**.rpm.checksum \ No newline at end of file