Created README for action usage

This commit is contained in:
Naveenraj M
2020-03-31 01:52:01 +05:30
parent 8eaa21bfb0
commit e4673b03fc

View File

@ -1,5 +1,58 @@
# Container Action Template # GitHub Action - RPM Build
To get started, click the `Use this template` button on this repository [which will create a new repository based on this template](https://github.blog/2019-06-06-generate-new-repositories-with-repository-templates/). 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).
For info on how to build your first Container action using the toolkit, see the [toolkit docs folder](https://github.com/actions/toolkit/blob/master/docs).
## Usage
### Pre-requisites
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow---build-rpm) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
This generated RPMS and SRPMS can be used in two ways.
1. Upload as build artifact
You can use GitHub Action [`@actions/upload-artifact`](https://www.github.com/actions/upload-artifact)
2. Upload as Release assest
If you want to upload as release asset ,You also will need to have a release to upload your asset to, which could be created programmatically by [`@actions/create-release`](https://www.github.com/actions/create-release) as show in the example workflow.
### Inputs
- `spec_file`: The path to the spec file in your repo. `**require**`
### Outputs
- `rpm_dir_path`: path to RPMS directory
- `source_rpm_path`: path to Source RPM file
- `source_rpm_dir_path`: path to SRPMS directory
- `source_rpm_name`: name of Source RPM file
- `rpm_content_type`: Content-type for RPM Upload
### Example workflow - build RPM
Basic:
```yaml
name: RPM Build
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: build RPM package
id: rpm
uses: naveenrajm7/rpmbuild@master
with:
spec_file: "cello.spec"
- name: Upload artifact
uses: actions/upload-artifact@v1.0.0
with:
name: Source RPM
path: ${{ steps.rpm.outputs.source_rpm_path }}
```
## License
The scripts and documentation in this project are released under the [GNU GPLv3](LICENSE)