Skip to content

Commit

Permalink
Add build pipeline for rpm-pkgs
Browse files Browse the repository at this point in the history
Pipelines regarding the build process of rpm-pkgs are now part of the
main BashPass repo, instead of having its own "BasPass-RPM". This
simplifies the release of newer versions, because of the auto-trigger
when a new tag is made, indicating a new release.

Since git(1), wl-clipboard(1) and other clipboard managers are not a
hard dependeny, they will have to be installed separately. This also
makes packageing much easier, since we can ignore xorg and wayland.
  • Loading branch information
AntonVanAssche committed Apr 22, 2024
1 parent 32519f2 commit 646e8eb
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/pkgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,39 @@ jobs:
with:
name: deb
path: bashpass_${{ env.RELEASE_VERSION }}_all.deb

build-rpm:
runs-on: ubuntu-latest

steps:
- name: Set env
run: |
printf 'RELEASE_VERSION=%s' "${GITHUB_REF#refs/*/v}" >> ${GITHUB_ENV}
- uses: actions/checkout@v3
with:
path: bashpass-${{ env.RELEASE_VERSION }}
ref: refs/tags/v${{env.RELEASE_VERSION }}

- name: Install required packages
run: |
/usr/bin/sudo /usr/bin/apt update
/usr/bin/sudo /usr/bin/apt install -y rpm
- name: Build RPM
run: |
/usr/bin/sed -i "s/RELEASE_VERSION/${{ env.RELEASE_VERSION }}/" bashpass-${{ env.RELEASE_VERSION }}/pkgs/rpm/bashpass.spec
/usr/bin/mkdir -pv ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
/usr/bin/cp -r bashpass-${{ env.RELEASE_VERSION }}/pkgs/rpm/bashpass.spec ~/rpmbuild/SPECS/
/usr/bin/tar -czf "bashpass-${{ env.RELEASE_VERSION }}.tar.gz" "bashpass-${{ env.RELEASE_VERSION }}"
/usr/bin/mv -v "bashpass-${{ env.RELEASE_VERSION }}.tar.gz" ~/rpmbuild/SOURCES/
/usr/bin/rpmbuild -bb ~/rpmbuild/SPECS/bashpass.spec
/usr/bin/cp -rv ~/rpmbuild/RPMS/noarch/* .
- uses: actions/upload-artifact@v3
with:
name: rpm
path: bashpass-${{ env.RELEASE_VERSION }}-1.noarch.rpm
43 changes: 43 additions & 0 deletions pkgs/rpm/bashpass.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
Name: bashpass
Version: RELEASE_VERSION
Release: 1
BuildArch: noarch
Summary: A command-line based password manager written in Bash.

License: MIT
URL: https://github.com/AntonVanAssche/BashPass
Source0: https://github.com/AntonVanAssche/BashPass/archive/refs/tags/%{name}-%{version}.tar.gz

Requires: bash gnupg2

%description
BashPass is a command-line based password manager written in Bash.
It uses GPG to encrypt/decrypt the files where the passwords are stored .
This means the passwords are 100% stored locally, so you don't have to trust a third party to store your passwords.

%prep
%autosetup

%install
rm -rf %{buildroot}

%{__mkdir_p} %{buildroot}%{_bindir}
%{__mkdir_p} %{buildroot}%{_mandir}/man1
%{__install} -m 0755 %{name} %{buildroot}%{_bindir}/%{name}
%{__install} -m 0644 docs/man/%{name}.1.gz %{buildroot}%{_mandir}/man1/%{name}.1.gz
%{__install} -m 0644 docs/man/%{name}.conf.1.gz %{buildroot}%{_mandir}/man1/%{name}.conf.1.gz

%clean
rm -rf %{buildroot}

%files
%{_bindir}/%{name}

%doc
%{_mandir}/man1/%{name}.1.gz
%{_mandir}/man1/%{name}.conf.1.gz

%license LICENSE.md

%changelog
%autochangelog

0 comments on commit 646e8eb

Please sign in to comment.