-
Notifications
You must be signed in to change notification settings - Fork 182
155 lines (129 loc) · 9.73 KB
/
rpm_mainnet_profiles.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: packager_mainnet_rpm_profiles
on:
push:
branches:
- 'master'
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/heimdall/packaging/templates/systemd/heimdalld-mainnet-sentry.service %{buildroot}/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-mainnet-sentry.spec
echo "cp /home/runner/work/heimdall/heimdall/packaging/templates/config/mainnet/config.toml %{buildroot}/var/lib/heimdall/config/config.toml" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec
echo "cp /home/runner/work/heimdall/heimdall/packaging/templates/config/mainnet/heimdall-config.toml %{buildroot}/var/lib/heimdall/config/heimdall-config.toml" >> packaging/rpm/SPECS/heimdall-amoy-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 "/var/lib/heimdall/config/config.toml" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec
echo "/var/lib/heimdall/config/heimdall-config.toml" >> packaging/rpm/SPECS/heimdall-amoy-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/heimdall/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/heimdall/packaging/templates/systemd/heimdalld-mainnet-validator.service %{buildroot}/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec
echo "cp /home/runner/work/heimdall/heimdall/packaging/templates/config/mainnet/config.toml %{buildroot}/var/lib/heimdall/config/config.toml" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec
echo "cp /home/runner/work/heimdall/heimdall/packaging/templates/config/mainnet/heimdall-config.toml %{buildroot}/var/lib/heimdall/config/heimdall-config.toml" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec
echo "%files" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec
echo "/lib/systemd/system/heimdalld.service" >> packaging/rpm/SPECS/heimdall-mainnet-validator.spec
echo "/var/lib/heimdall/config/config.toml" >> packaging/rpm/SPECS/heimdall-amoy-sentry.spec
echo "/var/lib/heimdall/config/heimdall-config.toml" >> packaging/rpm/SPECS/heimdall-amoy-sentry.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/heimdall/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/heimdall/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-validator-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/heimdall/heimdall/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/heimdall/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-sentry-config-${{ env.GIT_TAG1 }}-1.noarch.rpm /home/runner/work/heimdall/heimdall/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/heimdall/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-validator-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/heimdall/heimdall/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/heimdall/packaging/rpm_build/RPMS/noarch/heimdall-mainnet-sentry-config-${{ env.GIT_TAG1 }}.noarch.rpm > /home/runner/work/heimdall/heimdall/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