diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 6ec4a8e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM fedora:latest - -COPY ./entrypoint.sh /entrypoint.sh - -RUN dnf -y install rpmdevtools - -RUN rpmdev-setuptree - -ENTRYPOINT ["/entrypoint.sh"] diff --git a/action.yml b/action.yml index 16b82ee..80febf5 100644 --- a/action.yml +++ b/action.yml @@ -6,7 +6,25 @@ inputs: required: true 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: Build RPM + shell: bash + env: + SPEC_FILE_PATH: ${{ inputs.spec-file-path }} + run: | + SPEC_FILE_NAME=$(basename ${SPEC_FILE_PATH}) + podman run --rm \ + -v ./rpmbuild:/root/rpmbuild:rw,z \ + -v ./entrypoint.sh:/root/entrypoint.sh:ro,z \ + -w /root \ + fedora:latest \ + /root/entrypoint.sh /root/rpmbuild/SPECS/${SPEC_FILE_NAME} diff --git a/entrypoint.sh b/entrypoint.sh index 8e18f3b..7b971ab 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,4 +1,11 @@ -#!/bin/sh -l +#!/usr/bin/env bash -toolbox run rpmdev-spectool -g -C ~/rpmbuild/SOURCES $1 +dnf -y config-manager --add-repo https://git.hydrosaber.com/api/packages/hydros/rpm/f43.repo + +dnf -y install rpmdevtools +rpmdev-setuptree + +dnf -y builddep $1 + +rpmdev-spectool -g -C ~/rpmbuild/SOURCES $1 rpmbuild --nodebuginfo --bb $1