-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (49 loc) · 1.58 KB
/
Copy pathsrpm.yaml
File metadata and controls
52 lines (49 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: SRPM CI
on:
push:
branches:
- main
pull_reques:
permissions: write-all
jobs:
srpm:
name: Build SRPM
runs-on: ubuntu-latest
steps:
- name: Setup Podman
run: |
sudo apt update
sudo apt-get -y install podman
podman pull fedora
- name: Get source
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create container and build srpm
run: |
mkdir SRPMS
podman build -v $PWD:/project --tag rpmbuilder -f Containerfile
CID="$(podman run --rmi -v $PWD/SRPMS:/root/rpmbuild/SRPMS:rw,z,shared,bind,U -d rpmbuilder)"
podman exec $CID rpmbuild -bs "SPECS/cie-middleware.spec"
podman stop $CID
- name: Version
run: echo "version=$(ls SRPMS/*.rpm | cut -d'-' -f3 )" >> "$GITHUB_OUTPUT"
id: version
- name: Release
run: echo "release=$(ls SRPMS/*.rpm | cut -d'-' -f4 | cut -d'.' -f1)" >> "$GITHUB_OUTPUT"
id: release
- name: Sign
uses: FKLC/sign-files-action@v1.0.0
with:
privateKey: ${{ secrets.PRIVATE_KEY }}
extension: '.sha256.sig'
outputFolder: 'SRPMS'
files: |
SRPMS/*.rpm
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "public_key.pem,SRPMS/*.rpm,SRPMS/*.rpm.sha256.sig"
name: ${{ steps.version.outputs.version }}-${{ steps.release.outputs.release }}
tag: ${{ steps.version.outputs.version }}-${{ steps.release.outputs.release }}
commit: main