Compare commits
22 Commits
1fcd5a5848
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| c6628c58b5 | |||
| 8af940127f | |||
| 0cc905a79d | |||
| 9e40736cb7 | |||
| 04353ee147 | |||
| 3197993322 | |||
| 468f09a7a1 | |||
| 1bbc46c940 | |||
| d6ae96507b | |||
| 62e9b183cc | |||
| cc025c1767 | |||
| 5975c89780 | |||
| d03ee8b339 | |||
| f9a61a2d96 | |||
| 22d2f09bdf | |||
| ff054b53a0 | |||
| fe5f762047 | |||
| 7041c5f4ad | |||
| 9ab81474ec | |||
| 2fd8e42566 | |||
| b8bebe76ec | |||
| 93846393e8 |
@@ -2,4 +2,4 @@
|
||||
|
||||
A gitea action to build rpm with a given spec file.
|
||||
|
||||
Make sure that podman is installed
|
||||
Make sure that podman and iptables are installed
|
||||
|
||||
52
action.yml
52
action.yml
@@ -1,9 +1,24 @@
|
||||
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: "composite"
|
||||
@@ -16,6 +31,16 @@ runs:
|
||||
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:
|
||||
@@ -29,3 +54,26 @@ runs:
|
||||
-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} \;
|
||||
|
||||
@@ -1,11 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
dnf -y config-manager --add-repo https://git.hydrosaber.com/api/packages/hydros/rpm/f43.repo
|
||||
echo "--- Start adding repos and priorities ---"
|
||||
dnf5 -y config-manager addrepo --from-repofile=https://git.hydrosaber.com/api/packages/hydros/rpm/f43.repo
|
||||
|
||||
dnf -y install rpmdevtools
|
||||
echo "--- Setup workspace and packages ---"
|
||||
dnf5 -y install rpmdevtools
|
||||
rpmdev-setuptree
|
||||
|
||||
dnf -y builddep $1
|
||||
dnf5 -y builddep $1
|
||||
|
||||
echo "--- Download sources ---"
|
||||
rpmdev-spectool -g -C ~/rpmbuild/SOURCES $1
|
||||
rpmbuild --nodebuginfo --bb $1
|
||||
|
||||
echo "--- Add patches ---"
|
||||
cp ~/rpmbuild/PATCHES/* ~/rpmbuild/SOURCES
|
||||
|
||||
echo "--- Build RPM packages ---"
|
||||
rpmbuild --nodebuginfo --bb $1 && echo "--- Done! ---"
|
||||
|
||||
Reference in New Issue
Block a user