Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/actions/build-rpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

name: Build RPM
description: Use git-rpm-tools to build self as RPM and SRPM
runs:
using: "composite"
steps:
- name: Switch to branch to leave detached head state
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git checkout -b gha-build
shell: bash

- name: Build RPMs and SRPMs
run: ./scripts/git-rpm-tools -v -x ba
shell: bash
52 changes: 52 additions & 0 deletions .github/workflows/publish-rpm-on-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---

name: Publish RPMs and SRPMs on Release
on:
release:
types: [published]
jobs:
publish-rpm:
name: EL${{ matrix.el_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
el_version: [8, 9, 10]

container:
image: almalinux:${{ matrix.el_version }}

steps:
- name: Install dependencies
run: |
dnf -y install rpmdevtools git

- name: Checkout code
uses: actions/checkout@v6
with:
set-safe-directory: true
persist-credentials: false
fetch-depth: 0

- name: Build RPMs
uses: ./.github/actions/build-rpm

- name: Install GitHub CLI
run: |
dnf -y install 'dnf-command(config-manager)'
dnf config-manager --add-repo https://cli.github.com/packages/rpm/gh-cli.repo
dnf -y install gh --repo gh-cli

- name: Upload RPM as release asset
run: |
gh release upload ${{ github.event.release.tag_name }} $GITHUB_WORKSPACE/*.rpm --clobber
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload SRPM as release asset
run: |
gh release upload ${{ github.event.release.tag_name }} $GITHUB_WORKSPACE/*.src.rpm --clobber
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 1 addition & 6 deletions .github/workflows/self-build-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,5 @@ jobs:
persist-credentials: false
fetch-depth: 0

- name: Switch to branch to leave detached head state
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git checkout -b gha-build

- name: Build RPMs
run: ./scripts/git-rpm-tools
uses: ./.github/actions/build-rpm
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# git-rpm-tools v0.7
# git-rpm-tools v0.8

An utility which aims to trivialize creating RPMs from an existing git repository.

Expand Down
8 changes: 7 additions & 1 deletion dist/git-rpm-tools.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: git-rpm-tools
Version: 0.7
Version: 0.8
Release: 1%{?dist}
Summary: RPM packaging helper for Git repos

Expand Down Expand Up @@ -38,6 +38,12 @@ cp ./scripts/git-rpm-tools %{buildroot}/usr/local/bin
/usr/local/bin/*

%changelog
* Fri Mar 13 2026 Wlodek, Jakub <jwlodek@bnl.gov> - 0.8-1
- Add failure condition on cases where repo is in detatched HEAD state
- Add failure condition if git archive command fails
- Add failure condition if rpm build fails
- Updates to github actions CI workflows

* Wed Aug 14 2024 Derbenev, Anton <aderbenev@bnl.gov> - 0.7-1
- Added an option to specify a custom source tarball name
- Minor touch-ups to help message and options order
Expand Down
2 changes: 1 addition & 1 deletion scripts/git-rpm-tools
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

VERSION=0.6
VERSION=0.8
BUILD_TREE="$PWD/rpmbuildtree"

# Print warning message in stderr
Expand Down