Skip to content

Commit

Permalink
Restructure project directories and workflows
Browse files Browse the repository at this point in the history
Signed-off-by: László Várady <[email protected]>
  • Loading branch information
MrAnno committed May 15, 2024
1 parent ec70593 commit 81ffa3c
Show file tree
Hide file tree
Showing 20 changed files with 763 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: AxoSyslog Chart
name: AxoSyslog charts linter

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Charts
name: AxoSyslog charts release

on:
push:
Expand All @@ -19,7 +19,15 @@ jobs:
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Setup chart-releaser config
run: |
echo 'release-name-template: "{{ .Name }}-charts-{{ .Version }}"' > chart-releaser-config.yml
- name: Run chart-releaser
uses: helm/[email protected]
uses: helm/[email protected]
with:
config: chart-releaser-config.yml
charts_dir: charts
mark_as_latest: false
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create package from source tarball
name: AxoSyslog create packages from source tarball

on:
workflow_call:
Expand Down Expand Up @@ -36,11 +36,11 @@ jobs:

- name: Extract source tarball
run: |
mkdir syslog-ng
tar --strip-components=1 -xvf syslog-ng*.tar.gz -C syslog-ng
mkdir axosyslog
tar --strip-components=1 -xvf syslog-ng*.tar.gz -C axosyslog
- name: Prepare docker image
working-directory: syslog-ng
working-directory: axosyslog
run: |
if [[ "${{ inputs.dbld-image-mode }}" = "build" ]]
then
Expand All @@ -54,7 +54,7 @@ jobs:
fi
- name: Create package
working-directory: syslog-ng
working-directory: axosyslog
run: |
./dbld/rules package-${{ matrix.distro }}
Expand All @@ -65,7 +65,7 @@ jobs:
# 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/
cp -r axosyslog/dbld/build/${{ matrix.distro }} package/
- name: Store package as artifact
uses: actions/upload-artifact@v3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: syslog-ng Docker
name: AxoSyslog Docker image

on:
workflow_call:
Expand All @@ -23,7 +23,7 @@ env:

jobs:
docker:
name: syslog-ng Docker
name: AxoSyslog Docker image
if: github.repository_owner == 'axoflow'
runs-on: ubuntu-latest
steps:
Expand All @@ -35,13 +35,13 @@ jobs:
uses: actions/download-artifact@v4
with:
name: ${{ inputs.tarball-artifact }}
path: syslog-ng/apkbuild/axoflow/syslog-ng
path: docker/apkbuild/axoflow/axosyslog

- name: Download axosyslog-modules tarball artifact
uses: actions/download-artifact@v4
with:
name: ${{ inputs.axosyslog-modules-artifact }}
path: syslog-ng/apkbuild/axoflow/syslog-ng
path: docker/apkbuild/axoflow/axosyslog

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -55,7 +55,7 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (syslog-ng version) for Docker
- name: Extract metadata (AxoSyslog version) for Docker
id: docker-metadata-tags
uses: docker/metadata-action@v5
with:
Expand All @@ -81,8 +81,8 @@ jobs:
- name: Build and push production Docker image
uses: docker/build-push-action@v5
with:
context: syslog-ng
file: syslog-ng/alpine.dockerfile
context: docker
file: docker/alpine.dockerfile
platforms: ${{ env.PLATFORMS }}
push: true
tags: ${{ steps.tags.outputs.TAGS }}
Expand All @@ -96,8 +96,8 @@ jobs:
- name: Build and push debug Docker image
uses: docker/build-push-action@v5
with:
context: syslog-ng
file: syslog-ng/alpine.dockerfile
context: docker
file: docker/alpine.dockerfile
platforms: ${{ env.DEBUG_PLATFORM }}
push: true
tags: ${{ steps.tags.outputs.DEBUG_TAGS }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Packages
name: AxoSyslog packages
on:
workflow_call:
inputs:
Expand All @@ -11,7 +11,7 @@ on:
description: 'syslog-ng version'
required: true
type: string

workflow_dispatch:
inputs:
repo:
Expand Down Expand Up @@ -60,11 +60,11 @@ jobs:
- 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:
Expand All @@ -74,11 +74,11 @@ jobs:

create-packages:
needs: create-source-tarball
uses: ./.github/workflows/syslog-ng-create-packages.yml
uses: ./.github/workflows/axosyslog-create-packages.yml
with:
source-tarball-artifact-name: source-tarball
dbld-image-mode: cache
distros: |
distros: |
[
"almalinux-8"
]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: syslog-ng snapshot
name: AxoSyslog snapshot image

on:
workflow_dispatch:
Expand All @@ -15,11 +15,11 @@ on:
type: string
pull_request:
paths:
- 'syslog-ng/**'
- 'docker/**'
- '.github/workflows/**'
push:
paths:
- 'syslog-ng/**'
- 'docker/**'
- '.github/workflows/**'
schedule:
- cron: '00 23 * * *'
Expand Down Expand Up @@ -67,15 +67,15 @@ jobs:
uses: actions/checkout@v4

- name: Create AxoSyslog modules tarball
working-directory: syslog-ng
working-directory: docker
run: |
tar -czvf python-modules.tar.gz python-modules/
- name: Store axosyslog-modules tarball as artifact
uses: actions/upload-artifact@v4
with:
name: axosyslog-modules-tarball
path: syslog-ng/python-modules.tar.gz
path: docker/python-modules.tar.gz

build-and-test:
runs-on: ubuntu-latest
Expand All @@ -90,35 +90,35 @@ jobs:
uses: actions/download-artifact@v4
with:
name: source-tarball
path: syslog-ng/apkbuild/axoflow/syslog-ng
path: docker/apkbuild/axoflow/axosyslog

- name: Download axosyslog-modules tarball artifact
uses: actions/download-artifact@v4
with:
name: axosyslog-modules-tarball
path: syslog-ng/apkbuild/axoflow/syslog-ng
path: docker/apkbuild/axoflow/axosyslog

- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: syslog-ng
file: syslog-ng/alpine.dockerfile
context: docker
file: docker/alpine.dockerfile
load: true
tags: syslog-ng:test
tags: axosyslog:test
build-args: |
PKG_TYPE=nightly
SNAPSHOT_VERSION=${{ needs.tarball.outputs.snapshot-version }}
- name: Smoke test
run: |
export SYSLOG_NG_IMAGE="syslog-ng:test"
export SYSLOG_NG_IMAGE="axosyslog:test"
export SYSLOG_NG_VERSION="${{ needs.tarball.outputs.snapshot-version }}"
syslog-ng/tests/smoke.sh
docker/tests/smoke.sh
publish-image:
if: github.ref == 'refs/heads/main'
uses: ./.github/workflows/syslog-ng-docker.yml
uses: ./.github/workflows/axosyslog-docker.yml
needs: [tarball, build-and-test, axosyslog-modules]
with:
pkg-type: nightly
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: syslog-ng stable
name: AxoSyslog stable image

on:
workflow_dispatch:
push:
tags:
- 'syslog-ng-*'
- 'axosyslog-[0-9]+*'

jobs:
prepare:
Expand All @@ -19,7 +19,7 @@ jobs:
id: unpack_tag
with:
text: ${{ github.ref }}
regex: 'refs/tags/syslog-ng-(.*)'
regex: 'refs/tags/axosyslog-(.*)'
outputs:
version: ${{ steps.unpack_tag.outputs.group1 }}

Expand All @@ -31,26 +31,26 @@ jobs:
uses: actions/checkout@v4

- name: Create AxoSyslog modules tarball
working-directory: syslog-ng
working-directory: docker
run: |
tar -czvf python-modules.tar.gz python-modules/
- name: Store axosyslog-modules tarball as artifact
uses: actions/upload-artifact@v4
with:
name: axosyslog-modules-tarball
path: syslog-ng/python-modules.tar.gz
path: docker/python-modules.tar.gz

publish-packages:
uses: ./.github/workflows/syslog-ng-packages.yml
uses: ./.github/workflows/axosyslog-packages.yml
needs:
- prepare
with:
repo: syslog-ng/syslog-ng
version: ${{ needs.prepare.outputs.version }}

publish-image:
uses: ./.github/workflows/syslog-ng-docker.yml
uses: ./.github/workflows/axosyslog-docker.yml
needs:
- prepare
- axosyslog-modules
Expand Down
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

File renamed without changes.
Loading

0 comments on commit 81ffa3c

Please sign in to comment.