Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 41 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup ccache
run: mkdir -p ~/.ccache

- name: Restore ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-build-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}-
ccache-${{ runner.os }}-build-

- name: Load CI-Container
uses: ./.github/actions/load-container
with:
Expand All @@ -62,6 +74,9 @@ jobs:
- name: Build
run: ./scripts/container.sh ./scripts/ci-cd/step_build.sh

- name: Show ccache stats
run: ./scripts/container.sh ccache --show-stats || true

- name: Test
run: ./scripts/container.sh ./scripts/ci-cd/step_test.sh

Expand All @@ -78,6 +93,19 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup ccache
run: mkdir -p ~/.ccache

- name: Restore ccache
uses: actions/cache@v4
with:
path: ~/.ccache
key: ccache-${{ runner.os }}-package-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-package-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}-
ccache-${{ runner.os }}-package-
ccache-${{ runner.os }}-build-

- name: Load CI-Container
uses: ./.github/actions/load-container
with:
Expand All @@ -86,35 +114,17 @@ jobs:
- name: Package
run: ./scripts/container.sh ./scripts/ci-cd/step_package.sh

- name: Show ccache stats
run: ./scripts/container.sh ccache --show-stats || true

- name: Package Validate
run: ./scripts/container.sh ./scripts/ci-cd/step_package_validate.sh --skip-srpm-rebuild

- name: Upload SRPM artifact
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: srpm
path: build/packages/*.src.rpm
retention-days: 1

# ============================================
# Release (only on push to main)
# ============================================
release:
runs-on: ubuntu-latest
needs: package
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Download SRPM artifact
uses: actions/download-artifact@v4
with:
name: srpm
path: packages

# ==========================================
# Create GitHub Release (only on push to main)
# ==========================================
- name: Get version and generate release info
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
id: release_info
env:
COMMIT_SHA: ${{ github.sha }}
Expand All @@ -127,11 +137,11 @@ jobs:
echo "tag=v${VERSION}+${SHORT_SHA}" >> $GITHUB_OUTPUT

# Generate checksums
cd packages
cd build/packages
sha256sum *.src.rpm > SHA256SUMS

# Build release body with checksums embedded
cd ..
cd ../..
cat > release_body.md << EOF
Release of Common Low Level Tracing Kit

Expand All @@ -145,16 +155,17 @@ jobs:

## Checksums (SHA256)
\`\`\`
$(cat packages/SHA256SUMS)
$(cat build/packages/SHA256SUMS)
\`\`\`
EOF

- name: Create Release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release_info.outputs.tag }}
name: ${{ steps.release_info.outputs.version }}
body_path: release_body.md
files: |
packages/*.src.rpm
packages/SHA256SUMS
build/packages/*.src.rpm
build/packages/SHA256SUMS
4 changes: 3 additions & 1 deletion VERSION.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
1.2.58
1.2.59

# Change log
## 1.2.59
- ci: use ccache with GitHub cache to speed up builds
## 1.2.58
- cli: show features, git hash, license, and URL in --version output
- ci: auto-publish SRPM to GitHub releases when PRs are merged
Expand Down
1 change: 1 addition & 0 deletions scripts/container.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ RUN dnf -y install \
make \
gcc \
g++ \
ccache \
clang-tools-extra \
valgrind \
lcov \
Expand Down