naveenrajm7 / rpmbuild

A GitHub Action to build RPMs from source code and spec file, uses rpmbuild .
https://github.com/marketplace/actions/rpm-build
GNU General Public License v3.0
32 stars 48 forks source link

Spec file with variable such as 'version' - how do we pass them? #1

Open strus38 opened 4 years ago

strus38 commented 4 years ago

Hi Trying to build my spec file, it contains: %{!?version: %define version 1.2.0} ... I tried to pass the version as an env variable to the container, but it is ignored: - name: build RPM package id: rpm_build uses: naveenrajm7/rpmbuild@master env: version: 1.4.0 ... So how should I do? Thanks!

naveenrajm7 commented 4 years ago

Hi @strus38 , Thanks for trying out this Action. Currently, I rely on spec file for creating the source required by rpmbuild. Here is how it works in a nutshell

  1. Parse spec file get Name & Version
  2. Get repo contents and create a Source file with name \<name>-\<version>.tar.gz (move it to rpmbuild/SOURCE)
  3. Run rpmbuild
  4. Pass directory path for rpmbuild/RPMS and file path for rpmbuild/SRPMS as output , So it can be used by other Actions (like To Upload Release Asset or as Upload Artifact)

I do want to support multiple arguments in future versions like

As a quick response I can make version support by this week. If you would like to Contribute or give Suggestions , Please feel free to do so . Thanks!

strus38 commented 4 years ago

Hi

That explains why I see %{version} everywhere, and not the value I am passing through! Thanks. Concerning your proposal, that would be great indeed, but I currently not have time to fork and propose a pull request to you. So whenever you are ready, it will be perfect. Thanks!

Le mer. 15 avr. 2020 à 20:52, Naveenraj M notifications@github.com a écrit :

Hi @strus38 https://github.com/strus38 , Thanks for trying out this Action. Currently, I rely on spec file for creating the source required by rpmbuild. Here is how it works in a nutshell

  1. Parse spec file get Name & Version
  2. Get repo contents and create a Source file with name -.tar.gz (move it to rpmbuild/SOURCE)
  3. Run rpmbuild
  4. Pass directory path for rpmbuild/RPMS and file path for rpmbuild/SRPMS as output , So it can be used by other Actions (like To Upload Release Asset or as Upload Artifact)

I do want to support multiple arguments in future versions like

  • Name & Version of RPM package
  • Any BuildRequires that need to installed to create RPM .

As a quick response I can make version support by this week. If you would like to Contribute or give Suggestions , Please feel free to do so . Thanks!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/naveenrajm7/rpmbuild/issues/1#issuecomment-614217180, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABM6DU7ZMQJJOAF45DRJEITRMX65BANCNFSM4MIX7HZQ .

bschonec commented 8 months ago

@strus38 , have you made any updates to support your request? I would like to see this workflow support additional arguments such as, '--undefine=_disable_source_fetch' because sometimes the SOURCES tarball is downloaded directly from a http URL. I don't see any way that we can pass rpmbuild command line options but your suggestion implies that it's possible with a PR from you. Thoughts?