Compare commits

..

26 Commits

Author SHA1 Message Date
c6628c58b5 Bring back the find exec call to upload packages 2025-12-03 23:32:00 -05:00
8af940127f Make the search for a package more arch agnostic 2025-12-03 18:58:59 -05:00
0cc905a79d Attempt to put patches in a temp directory and add after source is
downloaded
2025-12-03 15:09:48 -05:00
9e40736cb7 Add feature to allow adding files from a directory to sources in
rpmbuild
2025-12-03 14:43:26 -05:00
04353ee147 Remove priority changes 2025-12-02 14:33:27 -05:00
3197993322 Remove ending remaining from the find exec 2025-12-02 14:13:26 -05:00
468f09a7a1 Corrected default group to f43 instead of 43 2025-12-02 13:57:32 -05:00
1bbc46c940 Listing upload url into logs 2025-12-02 13:48:16 -05:00
d6ae96507b Used wrong toggle for checking if var is not empty 2025-12-02 13:32:54 -05:00
62e9b183cc Try to give more information for troubleshooting 2025-12-02 13:28:02 -05:00
cc025c1767 Changed to be more limited to only a package following the same name and
devel
2025-12-02 12:55:59 -05:00
5975c89780 Previous name was correct, setting 2025-12-02 00:33:00 -05:00
d03ee8b339 Attempt to find actual repo to set priority. Make done only appear when
build succeed.
2025-12-01 23:17:24 -05:00
f9a61a2d96 Attempt label in repo file for name 2025-12-01 18:32:05 -05:00
22d2f09bdf Use up to date argument formats for config-manager 2025-12-01 18:29:44 -05:00
ff054b53a0 no need to save priority 2025-12-01 18:18:01 -05:00
fe5f762047 Add print statements to tell when certain processes begin and end. Added
priority to hydros repo to install newer devel tools
2025-12-01 16:05:37 -05:00
7041c5f4ad Changed so action publishes to repository owner 2025-11-30 22:03:55 -05:00
9ab81474ec Merge building and uploading into one step 2025-11-30 21:54:43 -05:00
2fd8e42566 Add uploading the package to the action 2025-11-30 17:54:33 -05:00
b8bebe76ec Use the up to date call for adding a repo 2025-11-30 17:52:08 -05:00
93846393e8 Corrected readme to current requirements 2025-11-30 17:45:12 -05:00
1fcd5a5848 Make entrypoint.sh executable 2025-11-30 15:19:43 -05:00
b2af6b1792 Use action_path to add entrypoint 2025-11-30 15:05:59 -05:00
011be46064 Correct readme to notify users to install podman 2025-11-30 14:28:38 -05:00
be8010a744 Remove dockerfile, using podman with latest snippet of working action 2025-11-30 14:22:31 -05:00
4 changed files with 92 additions and 19 deletions

View File

@@ -1,9 +0,0 @@
FROM fedora:latest
COPY ./entrypoint.sh /entrypoint.sh
RUN dnf -y install rpmdevtools
RUN rpmdev-setuptree
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -2,4 +2,4 @@
A gitea action to build rpm with a given spec file.
Requires toolbox and its dependencies.
Make sure that podman and iptables are installed

View File

@@ -1,12 +1,79 @@
name: Build RPM
description: "Builds rpm for given spec file"
name: Build and Upload RPM
description: "Builds rpm for given spec file and uploads to hydrosaber gitea repository."
inputs:
spec-file-path:
description: "Path to spec file for rpm"
required: true
package-group:
description: "Group repository to upload package to"
default: "f43"
repository-url:
description: "Gitea repository to upload package to"
default: "https://git.hydrosaber.com"
repository-user:
description: "User in repository to upload as"
required: true
repository-user-token:
description: "Token to use with user"
required: true
extra-source-directory:
description: "(Optional) Directory to grab files for sources."
default: ""
runs:
using: "docker"
image: "Dockerfile"
args:
- ${{ inputs.spec-file-path }}
using: "composite"
steps:
- name: Setup workspace
shell: bash
env:
SPEC_FILE_PATH: ${{ inputs.spec-file-path }}
run: |
mkdir -p ./rpmbuild/{RPMS,SPECS}
cp ${SPEC_FILE_PATH} ./rpmbuild/SPECS
- name: Add extra source files
shell: bash
if: "${{ inputs.extra-source-directory != '' }}"
env:
SOURCE_DIRECTORY: ${{ inputs.extra-source-directory }}
run: |
mkdir -p ./rpmbuild/PATCHES
find ${SOURCE_DIRECTORY} -type f -not -name "*\.spec" \
-exec cp {} ./rpmbuild/PATCHES \;
- name: Build RPM
shell: bash
env:
SPEC_FILE_PATH: ${{ inputs.spec-file-path }}
ACTION_ROOT: ${{ gitea.action_path }}
run: |
SPEC_FILE_NAME=$(basename ${SPEC_FILE_PATH})
podman run --rm \
-v ./rpmbuild:/root/rpmbuild:rw,z \
-v ${ACTION_ROOT}/entrypoint.sh:/root/entrypoint.sh:ro,z \
-w /root \
fedora:latest \
/root/entrypoint.sh /root/rpmbuild/SPECS/${SPEC_FILE_NAME}
- name: Upload package
shell: bash
env:
SPEC_FILE_PATH: ${{ inputs.spec-file-path }}
REPOSITORY_URL: ${{ inputs.repository-url }}
PACKAGE_GROUP: ${{ inputs.package-group }}
REPOSITORY_OWNER: ${{ gitea.repository_owner }}
UPLOAD_USER: ${{ inputs.repository-user }}
UPLOAD_USER_TOKEN: ${{ inputs.repository-user-token }}
run: |
PACKAGE_NAME=$(basename -s .spec ${SPEC_FILE_PATH})
echo "Goal package to upload: ${PACKAGE_NAME}"
RPM_PATH="./rpmbuild/RPMS/"
echo "Searching in ${RPM_PATH}"
find ./rpmbuild/RPMS/ -type f -name "*.rpm"
UPLOAD_URL="${REPOSITORY_URL}/api/packages/${REPOSITORY_OWNER}/rpm/${PACKAGE_GROUP}/upload"
echo "Uploading to url: ${UPLOAD_URL}"
find ./rpmbuild/RPMS/ -name "*.rpm" -type f \
-exec curl \
--user ${UPLOAD_USER}:${UPLOAD_USER_TOKEN} \
--upload-file {} \
${UPLOAD_URL} \;

21
entrypoint.sh Normal file → Executable file
View File

@@ -1,4 +1,19 @@
#!/bin/sh -l
#!/usr/bin/env bash
toolbox run rpmdev-spectool -g -C ~/rpmbuild/SOURCES $1
rpmbuild --nodebuginfo --bb $1
echo "--- Start adding repos and priorities ---"
dnf5 -y config-manager addrepo --from-repofile=https://git.hydrosaber.com/api/packages/hydros/rpm/f43.repo
echo "--- Setup workspace and packages ---"
dnf5 -y install rpmdevtools
rpmdev-setuptree
dnf5 -y builddep $1
echo "--- Download sources ---"
rpmdev-spectool -g -C ~/rpmbuild/SOURCES $1
echo "--- Add patches ---"
cp ~/rpmbuild/PATCHES/* ~/rpmbuild/SOURCES
echo "--- Build RPM packages ---"
rpmbuild --nodebuginfo --bb $1 && echo "--- Done! ---"