Skip to content

Commit a135ddf

Browse files
Build on el8/el9, sign rpm, deploy to pkg_01 (#28)
* Build on el8 and el9, run ci for both of them as well * Rename ci to ci_container_matrix
1 parent 6e52257 commit a135ddf

6 files changed

Lines changed: 109 additions & 47 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: CI
2+
3+
on: [ push ]
4+
5+
jobs:
6+
upload:
7+
name: CI
8+
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
os: [ "el8", "el9" ]
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Build container
21+
run: docker build . --tag builder -f "Dockerfile.${{ matrix.os }}"
22+
23+
- name: Build project
24+
run: docker run -v "${{ github.workspace }}:/code:Z" builder

.github/workflows/maven-publish.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Upload Artifact as GitHub Release Attachment
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
upload:
9+
name: Build and upload release
10+
runs-on: ubuntu-latest
11+
strategy:
12+
max-parallel: 1
13+
matrix:
14+
os: [ "el8", "el9" ]
15+
permissions:
16+
contents: write
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Cache Local Maven Repository
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.m2/repository
27+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
28+
29+
- name: Setup Java
30+
uses: actions/setup-java@v4
31+
with:
32+
java-version: 8.0.292+10
33+
distribution: 'adopt'
34+
35+
- name: Build container
36+
run: docker build . --tag builder -f "Dockerfile.${{ matrix.os }}"
37+
38+
- name: Build project
39+
run: docker run -v "${{ github.workspace }}:/code:Z" builder
40+
41+
- name: Prepare RPM GPG signing
42+
run: |
43+
sudo apt-get install expect pinentry-tty;
44+
printf "RPM_SIGNING_KEYNAME=%q\n" "$(echo "${{ secrets.RPM_SIGNING_PUBLIC_KEY }}" | gpg --show-keys --with-colons | awk -F':' '/uid/{print $10}')" >> $GITHUB_ENV;
45+
echo "${{ secrets.RPM_SIGNING_PRIVATE_KEY }}" | gpg --batch --import;
46+
echo "%_gpg_sign_cmd_extra_args --pinentry-mode loopback --passphrase \"%{getenv:RPM_SIGNING_PASSPHRASE}\"" >> "${HOME}/.rpmmacros";
47+
48+
- name: Build and sign the rpm
49+
run: mvn --batch-mode -Drevision=${{ github.event.release.tag_name }} -Dsha1= -Dchangelist= -Ppublish-github-packages -f rpm.pom.xml package
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
OS_VERSION: ${{ matrix.os }}
53+
RPM_SIGNING_KEYNAME: ${{ env.RPM_SIGNING_KEYNAME }}
54+
RPM_SIGNING_PASSPHRASE: ${{ secrets.RPM_SIGNING_PASSPHRASE }}
55+
56+
- name: Attach rpm to release
57+
uses: softprops/action-gh-release@v2
58+
with:
59+
files: target/rpm/com.teragrep-blf_02/RPMS/x86_64/com.teragrep-blf_02-*.rpm
60+
61+
- name: Update pkg_01 releases repository
62+
uses: teragrep/[email protected]
63+
with:
64+
from_repository: "${{ github.repository }}"
65+
from_version: "${{ github.event.release.tag_name }}"
66+
to_repository: "${{ github.repository_owner }}/pkg_01"
67+
to_path: "linux/${{ matrix.os }}"
68+
deploy_key: ${{ secrets.PKG_01_DEPLOY_KEY }}
69+
files: target/rpm/com.teragrep-blf_02/RPMS/x86_64/com.teragrep-blf_02-*.rpm
70+
gpg_public_key: "${{ secrets.RPM_SIGNING_PUBLIC_KEY }}"
71+
repo_baseurl: "${{ vars.PKG_01_CENTRAL_BASEURL }}"
72+
repo_name: "teragrep-${{ matrix.os }}-releases"
73+
env:
74+
has_deploy_key: ${{ secrets.PKG_01_DEPLOY_KEY != '' }}
75+
if: ${{ env.has_deploy_key == 'true' }}
File renamed without changes.

Dockerfile.el9

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM rockylinux:9
2+
RUN dnf -y --enablerepo=devel install make automake autoconf libtool mariadb-devel
3+
WORKDIR /code
4+
COPY docker-entrypoint.sh /docker-entrypoint.sh
5+
ENTRYPOINT [ "/docker-entrypoint.sh" ]

rpm.pom.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<packaging>rpm</packaging>
66
<modelVersion>4.0.0</modelVersion>
77
<artifactId>blf_02</artifactId>
8-
<version>${revision}${sha1}${changelist}.el8</version>
8+
<version>${revision}${sha1}${changelist}.${env.OS_VERSION}</version>
99
<name>blf_02</name>
1010
<description>Teragrep Bloom Filter Plugin for MariaDB</description>
1111
<groupId>com.teragrep</groupId>
@@ -57,6 +57,10 @@
5757
<defaultGroupname>root</defaultGroupname>
5858
<defaultFilemode>0644</defaultFilemode>
5959
<defaultDirmode>0755</defaultDirmode>
60+
<keyname>${env.RPM_SIGNING_KEYNAME}</keyname>
61+
<keyPassphrase>
62+
<passphrase>${env.RPM_SIGNING_PASSPHRASE}</passphrase>
63+
</keyPassphrase>
6064
<defineStatements>
6165
<!-- _python_bytecompile_extra 0 doesn't work so we take the original script and just replace what we do not want -->
6266
<defineStatement>__os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')</defineStatement>

0 commit comments

Comments
 (0)