You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+99-9Lines changed: 99 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,12 @@ Integrates easily with GitHub actions to allow RPMS to be uploaded as Artifact (
8
8
### Pre-requisites
9
9
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).
10
10
11
-
This generated RPMS and SRPMS can be used in two ways.
12
-
1. Upload as build artifact
13
-
You can use GitHub Action [`@actions/upload-artifact`](https://www.github.com/actions/upload-artifact)
14
-
2. Upload as Release assest
15
-
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.
11
+
**Note:** You need to have a spec file in order to build RPM.
12
+
16
13
17
14
### Inputs
18
15
19
-
-`spec_file`: The path to the spec file in your repo. `**require**`
16
+
-`spec_file`: The path to the spec file in your repo. [**required**]
20
17
21
18
### Outputs
22
19
@@ -26,6 +23,11 @@ This generated RPMS and SRPMS can be used in two ways.
26
23
-`source_rpm_name`: name of Source RPM file
27
24
-`rpm_content_type`: Content-type for RPM Upload
28
25
26
+
This generated RPMS and SRPMS can be used in two ways.
27
+
1. Upload as build artifact
28
+
You can use GitHub Action [`@actions/upload-artifact`](https://www.github.com/actions/upload-artifact)
29
+
2. Upload as Release assest
30
+
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.
This workflow triggered on every `push` , builds RPM and Source RPM using cello.spec and contents of that git ref that triggered that action. Contents are retrived through [GitHub API](https://developer.github.com/v3/repos/contents/#get-archive-link) [downloaded through archive link].
58
+
The generated RPMs or SRPMS can be uploaded as artifacts by using actions/upload-artifact. The [outputs](#outputs) given by rpmbuild action can be used to specify path for upload action.
59
+
60
+
#### Above workflow will create an artifact like :
61
+
62
+
[artifact_image](!assests/upload_artifacts.png)
63
+
<img src="assests/upload_artifacts.png" alt>
64
+
65
+
Use with Release:
66
+
```yaml
67
+
on:
68
+
push:
69
+
# Sequence of patterns matched against refs/tags
70
+
tags:
71
+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
72
+
73
+
name: Create RPM Release
74
+
75
+
jobs:
76
+
build:
77
+
name: Create RPM Release
78
+
runs-on: ubuntu-latest
79
+
80
+
steps:
81
+
82
+
- name: Checkout code
83
+
uses: actions/checkout@master
84
+
85
+
- name: Create Release
86
+
id: create_release
87
+
uses: actions/create-release@latest
88
+
env:
89
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
90
+
with:
91
+
tag_name: ${{ github.ref }}
92
+
release_name: Release ${{ github.ref }}
93
+
body: |
94
+
Changes in this Release
95
+
- Create RPM
96
+
- Upload Source RPM
97
+
draft: false
98
+
prerelease: false
99
+
100
+
- name: build RPM package
101
+
id: rpm_build
102
+
uses: naveenrajm7/rpmbuild@master
103
+
with:
104
+
spec_file: "cello.spec"
105
+
106
+
- name: Upload Release Asset
107
+
id: upload-release-asset
108
+
uses: actions/upload-release-asset@v1
109
+
env:
110
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111
+
with:
112
+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
0 commit comments