Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build and publish binaries on release by using goreleaser #725

Closed
wants to merge 2 commits into from

Conversation

kurokobo
Copy link
Contributor

A GoReleaser version of #724 including building RPMs.

In my opinion, #724 is preferable at this time, so I am marking this PR as draft.
If this is more desirable than #724, please let me know and I will remove the draft.

Demos

Notes

  • These RPMs are not signed.
  • These RPMs are built by GoReleaser's nFPM, not rpmbuild. Therefore, there is no spec file.
  • The contents of RPMs are based on the RPM and SRPM on Copr (but not fully test since this is just a demo purpose).

Tests

$ curl -LO https://github.com/kurokobo/receptor/releases/download/v1.3.1-demo3/receptor_1.3.1-demo3_linux_amd64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 21.0M  100 21.0M    0     0  5331k      0  0:00:04  0:00:04 --:--:-- 8377k

$ tar zxvf receptor_1.3.1-demo3_linux_amd64.tar.gz 
receptor

$ ./receptor --version
v1.3.1-demo3
$ curl -LO https://github.com/kurokobo/receptor/releases/download/v1.3.1-demo3/receptor_1.3.1-demo3_linux_amd64.rpm
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 21.7M  100 21.7M    0     0  11.0M      0  0:00:01  0:00:01 --:--:-- 18.3M

$ rpm -qi receptor_1.3.1-demo3_linux_amd64.rpm 
Name        : receptor
Epoch       : 0
Version     : 1.3.1~demo3
Release     : 1
Architecture: x86_64
Install Date: (not installed)
Group       : Unspecified
Size        : 50782662
License     : ASL 2.0
Signature   : (none)
Source RPM  : receptor-1.3.1~demo3-1.src.rpm
Build Date  : Tue 24 Jan 2023 02:02:16 AM JST
Build Host  : fv-az646-862
Relocations : (not relocatable)
Packager    : 
Vendor      : Ansible
URL         : https://github.com/ansible/receptor
Summary     : Project Receptor is a flexible multi-service relayer with remote execution and orchestration capabilities linking controllers with executors across a mesh of nodes.
Description :
Project Receptor is a flexible multi-service relayer with remote execution and orchestration capabilities linking controllers with executors across a mesh of nodes.

$ rpm -ql receptor_1.3.1-demo3_linux_amd64.rpm 
/etc/logrotate.d/receptor
/etc/receptor
/etc/receptor/receptor.conf
/etc/receptor/receptor.conf.example
/usr/bin/receptor
/usr/lib/systemd/system/receptor.service
/usr/lib/systemd/system/receptor@.service
/usr/share/bash-completion/completions/receptor
/usr/share/selinux/packages/receptor.pp
/usr/share/sosreport/sos/plugins/receptor.py
/var/lib/receptor
/var/log/receptor
/var/run/receptor

$ rpm -qp --scripts receptor_1.3.1-demo3_linux_amd64.rpm 
preinstall scriptlet (using /bin/sh):
getent group receptor >/dev/null || groupadd -r receptor
getent passwd receptor >/dev/null || \
    useradd -r -g receptor -d /var/lib/receptor -s /bin/bash receptor

postinstall scriptlet (using /bin/sh):
distro_python_sitelib=$(/usr/libexec/platform-python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
semodule -n -i /usr/share/selinux/packages/receptor.pp
if /usr/sbin/selinuxenabled ; then
    /usr/sbin/load_policy
fi;
ln -s /usr/share/sosreport/sos/plugins/receptor.py ${distro_python_sitelib}/sos/report/plugins/receptor.py || :
exit 0

postuninstall scriptlet (using /bin/sh):
distro_python_sitelib=$(/usr/libexec/platform-python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
if [ $1 -eq 0 ]; then
    semodule -n -r receptor
    if /usr/sbin/selinuxenabled ; then
       /usr/sbin/load_policy
    fi;
    rm -f ${distro_python_sitelib}/sos/report/plugins/receptor.py || :
fi;
exit 0

@kurokobo
Copy link
Contributor Author

Closing this since #724 is merged.

@kurokobo kurokobo deleted the publish-by-goreleaser branch March 15, 2023 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant