Skip to content
Merged
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
39 changes: 26 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,27 @@
This GitHub Action builds RPMs from spec file and using repository contents as source (wraps the rpmbuild utility).
Integrates easily with GitHub actions to allow RPMS to be uploaded as Artifact (actions/upload-artifact) or as Release Asset (actions/upload-release-asset).

## SEPE Fork Notice

This repository is a fork of [`naveenrajm7/rpmbuild`](https://github.com/naveenrajm7/rpmbuild),
created on 2024-02-12 to carry CU Boulder OIT Platform Engineering (SEPE)
modifications. It is used by the `oit-sepe-naemon-build` pipeline (and any
other SEPE repos that build RPMs via GitHub Actions). Upstream has been
effectively dormant since November 2022, so this fork is intentionally not
tracked against upstream — changes land here directly.
Comment thread
eschoeller marked this conversation as resolved.

SEPE-specific modifications on top of upstream:

- **AlmaLinux 8 base image.** Switched the Dockerfile from CentOS to AlmaLinux 8,
replaced `yum` with `dnf`, enabled the `powertools` repository, pinned Python
to `python39`, and bumped the Node.js tooling used to build the action.
- **Patch file support.** `src/main.ts` copies any `*.patch` files from the
repo root into `/github/home/rpmbuild/SOURCES/` before invoking `rpmbuild`,
so spec files can reference them via standard `Patch0:`/`Patch1:`/...
declarations. No-op if the repo has no patch files.

Before making further changes, verify the divergence from upstream
(`naveenrajm7/rpmbuild`) and update this notice.

## Usage
### Pre-requisites
Expand Down Expand Up @@ -45,7 +66,7 @@ jobs:

- name: build RPM package
id: rpm
uses: naveenrajm7/rpmbuild@master
uses: UCBoulder/oit-sepe-rpmbuild@master
with:
spec_file: "cello.spec"
additional_repos: "['centos-release-scl', 'http://www.percona.com/downloads/percona-release/redhat/0.1-3/percona-release-0.1-3.noarch.rpm']"
Expand Down Expand Up @@ -100,7 +121,7 @@ jobs:

- name: build RPM package
id: rpm_build
uses: naveenrajm7/rpmbuild@master
uses: UCBoulder/oit-sepe-rpmbuild@master
with:
spec_file: "cello.spec"

Expand All @@ -123,17 +144,9 @@ jobs:
Example Repository which uses rpmbuild action https://github.com/naveenrajm7/cello

Note on distribution:
If your RPMs are distribution specific like el7 or el8.
- Use naveenrajm7/rpmbuild@master for Centos7 *[el7]*
- Use naveenrajm7/rpmbuild@centos8 for Centos8 *[el8]*

```yaml
- name: build RPM package
id: rpm_build
uses: naveenrajm7/rpmbuild@centos8
with:
spec_file: "cello.spec"
```
This fork builds AlmaLinux 8 (`el8`) RPMs only, tracked on the `master`
branch. Upstream's `centos8` branch and multi-distribution variants are
not maintained here.

## Contribute

Expand Down
12 changes: 12 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ async function run() {
await exec.exec(`ln -s /github/home/rpmbuild/SOURCES/${name}-${version}.tar.gz /github/home/rpmbuild/SOURCES/${name}.tar.gz`);
process.env.GIT_DIR = oldGitDir;

// Copy any *.patch files from the repo root into SOURCES so spec files
// can reference them via standard Patch0:/Patch1:/... declarations.
// No-op if the repo has no patch files.
const workspaceFiles = fs.readdirSync('/github/workspace');
for (const f of workspaceFiles) {
if (!f.endsWith('.patch')) continue;
const fullPath = path.join('/github/workspace', f);
if (!fs.statSync(fullPath).isFile()) continue;
console.log(`Copying patch file to SOURCES: ${f}`);
await exec.exec('cp', [fullPath, '/github/home/rpmbuild/SOURCES/']);
}

// Installs additional repositories
const additionalRepos = core.getInput('additional_repos'); // user input, eg: '["centos-release-scl"]'
if (additionalRepos) {
Expand Down