forked from metabrainz/KeyDB
-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (97 loc) · 2.98 KB
/
Copy pathrpm-el9.yml
File metadata and controls
110 lines (97 loc) · 2.98 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: RPM EL9
on:
pull_request:
paths:
- .github/workflows/rpm-el9.yml
- pkg/rpm/el9/**
- src/**
- deps/**
- keydb.conf
- sentinel.conf
- Makefile
workflow_dispatch:
inputs:
source_ref:
description: Git ref containing the KeyDB source to package
required: true
default: v6.3.6
type: string
release_tag:
description: Existing release that receives RPM assets when enabled
required: true
default: v6.3.6
type: string
upload_to_release:
description: Upload the validated RPMs to the existing release
required: true
default: false
type: boolean
permissions:
contents: read
concurrency:
group: rpm-el9-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
runs-on: ubuntu-22.04
timeout-minutes: 90
steps:
- name: Check out packaging changes
uses: actions/checkout@v4
with:
path: packaging
persist-credentials: false
- name: Check out KeyDB 6.3.6 source
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.source_ref || 'v6.3.6' }}
path: source
fetch-depth: 0
persist-credentials: false
submodules: recursive
- name: Build and validate RPM inside Oracle Linux 9
shell: bash
run: |
set -euo pipefail
mkdir -p artifacts
SOURCE_DATE_EPOCH=$(git -C source show -s --format=%ct HEAD)
export SOURCE_DATE_EPOCH
docker run --rm \
-e SOURCE_DATE_EPOCH \
-v "$GITHUB_WORKSPACE/source:/src:ro" \
-v "$GITHUB_WORKSPACE/packaging/pkg/rpm/el9:/packaging:ro" \
-v "$GITHUB_WORKSPACE/artifacts:/out" \
oraclelinux:9 \
/packaging/build-el9-rpm.sh
sudo chown -R "$(id -u):$(id -g)" artifacts
- name: Upload RPM artifacts
uses: actions/upload-artifact@v4
with:
name: keydb-6.3.6-el9-x86_64-${{ github.run_id }}
path: artifacts/
if-no-files-found: error
retention-days: 30
release:
needs: build-and-test
if: github.event_name == 'workflow_dispatch' && inputs.upload_to_release
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- name: Download validated RPM artifacts
uses: actions/download-artifact@v4
with:
name: keydb-6.3.6-el9-x86_64-${{ github.run_id }}
path: artifacts
- name: Upload RPMs to the existing release
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
gh release view "${{ inputs.release_tag }}"
gh release upload "${{ inputs.release_tag }}" \
artifacts/*.rpm \
artifacts/SHA256SUMS \
artifacts/rpm-manifest.txt \
--clobber