-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
new workflows for axosyslog rpm build
- Loading branch information
1 parent
145356d
commit 9a32f38
Showing
3 changed files
with
183 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Create package from source tarball | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
source-tarball-artifact-name: | ||
required: true | ||
type: string | ||
dbld-image-mode: | ||
required: true | ||
type: string # cache / build | ||
distros: | ||
required: false | ||
type: string | ||
default: | | ||
[ | ||
"almalinux-8", | ||
] | ||
jobs: | ||
create-packages: | ||
name: ${{ matrix.distro }} | ||
|
||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
distro: ${{ fromJson(inputs.distros) }} | ||
fail-fast: false | ||
|
||
steps: | ||
- name: Download source tarball artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.source-tarball-artifact-name }} | ||
|
||
- name: Extract source tarball | ||
run: | | ||
mkdir syslog-ng | ||
tar --strip-components=1 -xvf syslog-ng*.tar.gz -C syslog-ng | ||
- name: Prepare docker image | ||
working-directory: syslog-ng | ||
run: | | ||
if [[ "${{ inputs.dbld-image-mode }}" = "build" ]] | ||
then | ||
./dbld/rules image-${{ matrix.distro }} | ||
elif [[ "${{ inputs.dbld-image-mode }}" = "cache" ]] | ||
then | ||
./dbld/rules cache-image-${{ matrix.distro }} | ||
else | ||
echo Unexpected input: dbld-image-mode=${{ inputs.dbld-image-mode }} | ||
false | ||
fi | ||
- name: Create package | ||
working-directory: syslog-ng | ||
run: | | ||
./dbld/rules package-${{ matrix.distro }} | ||
- name: Prepare package for artifact | ||
# We want to keep the directory structure starting with ${{ matrix.distro }}, | ||
# but it can only be done, if we give its parent directory as `path` to upload-artifact. | ||
# There are other directories in dbld/build which we do not want to upload, | ||
# so let's make a temporary directory and move the ${{ matrix.distro }} directory there. | ||
run: | | ||
mkdir package | ||
cp -r syslog-ng/dbld/build/${{ matrix.distro }} package/ | ||
- name: Store package as artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: package-${{ matrix.distro }} | ||
path: package/* | ||
if-no-files-found: error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Packages | ||
on: | ||
workflow_call: | ||
inputs: | ||
repo: | ||
description: 'syslog-ng repository' | ||
required: true | ||
default: 'syslog-ng/syslog-ng' | ||
type: string | ||
version: | ||
description: 'syslog-ng version' | ||
required: true | ||
type: string | ||
|
||
workflow_dispatch: | ||
inputs: | ||
repo: | ||
description: 'syslog-ng repository' | ||
required: true | ||
default: 'syslog-ng/syslog-ng' | ||
type: string | ||
version: | ||
description: 'syslog-ng version' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
create-source-tarball: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get syslog-ng tarball | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh release download --repo '${{ inputs.repo }}' -p 'syslog-ng-${{ inputs.version }}.tar.gz' 'syslog-ng-${{ inputs.version }}' | ||
- name: Extract source tarball | ||
run: | | ||
mkdir syslog-ng | ||
tar --strip-components=1 -xvf syslog-ng*.tar.gz -C syslog-ng | ||
rm syslog-ng*.tar.gz | ||
- name: AxoSyslog patches | ||
working-directory: syslog-ng | ||
run: | | ||
sed -i 's/Name: syslog-ng/Name: axosyslog/' packaging/rhel/syslog-ng.spec | ||
sed -i 's|%{name}-%{version}.tar.gz|syslog-ng-%{version}.tar.gz|' packaging/rhel/syslog-ng.spec | ||
sed -i 's|URL.*|URL: https://axoflow.com/docs/axosyslog-core/|' packaging/rhel/syslog-ng.spec | ||
sed -i 's|Provides: syslog|&\n\nConflicts: syslog-ng\nConflicts: syslog-ng-premium-edition|' packaging/rhel/syslog-ng.spec | ||
sed -i 's|%setup -q|%setup -q -n syslog-ng-%{version}|' packaging/rhel/syslog-ng.spec | ||
sed -i 's|/%{name}|/syslog-ng|g' packaging/rhel/syslog-ng.spec | ||
sed -i 's|/lib%{name}|/libsyslog-ng|g' packaging/rhel/syslog-ng.spec | ||
sed -i 's|^.*czanik/syslog-ng-githead.*$||' dbld/builddeps | ||
# Remove extra dependencies | ||
sed -i 's|almalinux.*|&,nocriterion,noriemann,nokafka,nomqtt,nojava|' dbld/build.manifest | ||
cat packaging/rhel/syslog-ng.spec | ||
- name: Prepare docker image | ||
working-directory: syslog-ng | ||
run: ./dbld/rules cache-image-tarball | ||
|
||
- name: Create source tarball | ||
working-directory: syslog-ng | ||
run: ./dbld/rules pkg-tarball | ||
|
||
- name: Store source tarball as artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: source-tarball | ||
path: syslog-ng/dbld/build/*.tar.* | ||
if-no-files-found: error | ||
|
||
create-packages: | ||
needs: create-source-tarball | ||
uses: ./.github/workflows/syslog-ng-create-packages.yml | ||
with: | ||
source-tarball-artifact-name: source-tarball | ||
dbld-image-mode: cache | ||
distros: | | ||
[ | ||
"almalinux-8" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters