Skip to content

Commit 222b6c5

Browse files
arrowplumCopilot
andauthored
INFRA-126 - Full build example with packaging (#33)
* feat(workflows): enhance Makefile for building and packaging applications * fix(workflows): update artifact name format in reusable integration workflow * feat(workflows): add combine-artifacts job to reusable integration workflow * feat: add ARM runner support for matrix builds * feat: add packaging script for multi-arch/multi-distro binaries --------- Co-authored-by: Copilot <[email protected]>
1 parent 34ffd46 commit 222b6c5

10 files changed

+594
-19
lines changed
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Example Reusable Integration
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
branches: [main]
6+
7+
permissions:
8+
id-token: write
9+
contents: read
10+
packages: write
11+
12+
jobs:
13+
build-packages:
14+
uses: ./.github/workflows/reusable_execute-build.yaml
15+
strategy:
16+
matrix:
17+
include:
18+
# Ubuntu/Debian family (x86_64)
19+
- distro: jammy
20+
arch: x86_64
21+
runs-on: ubuntu-22.04
22+
emulated: false
23+
- distro: noble
24+
arch: x86_64
25+
runs-on: ubuntu-22.04
26+
emulated: false
27+
- distro: focal
28+
arch: x86_64
29+
runs-on: ubuntu-22.04
30+
emulated: false
31+
- distro: bullseye
32+
arch: x86_64
33+
runs-on: ubuntu-22.04
34+
emulated: false
35+
- distro: bookworm
36+
arch: x86_64
37+
runs-on: ubuntu-22.04
38+
emulated: false
39+
# Ubuntu/Debian family (arm64) - emulated by default
40+
# set emulated to false to run on real arm64 runners but as of 8/14/2025, the queue times are too long
41+
- distro: jammy
42+
arch: arm64
43+
runs-on: ubuntu-22.04
44+
emulated: true
45+
- distro: noble
46+
arch: arm64
47+
runs-on: ubuntu-22.04
48+
emulated: true
49+
- distro: focal
50+
arch: arm64
51+
runs-on: ubuntu-22.04
52+
emulated: true
53+
- distro: bullseye
54+
arch: arm64
55+
runs-on: ubuntu-22.04
56+
emulated: true
57+
- distro: bookworm
58+
arch: arm64
59+
runs-on: ubuntu-22.04
60+
emulated: true
61+
# RPM family (x86_64 only - no ARM support)
62+
- distro: el8
63+
arch: x86_64
64+
runs-on: ubuntu-22.04
65+
emulated: false
66+
- distro: el9
67+
arch: x86_64
68+
runs-on: ubuntu-22.04
69+
emulated: false
70+
- distro: amzn2023
71+
arch: x86_64
72+
runs-on: ubuntu-22.04
73+
emulated: false
74+
# RPM family (arm64) - requires real ARM runners (commented out due to queue times)
75+
# - distro: el8
76+
# arch: arm64
77+
# runs-on: ubuntu-latest-arm64
78+
# emulated: false
79+
# - distro: el9
80+
# arch: arm64
81+
# runs-on: ubuntu-latest-arm64
82+
# emulated: false
83+
# - distro: amzn2023
84+
# arch: arm64
85+
# runs-on: ubuntu-latest-arm64
86+
# emulated: false
87+
with:
88+
runs-on: ${{ matrix.runs-on }}
89+
project: database
90+
build-name: test-build
91+
build-version: v1.0.0
92+
build-script: |
93+
cd .github/workflows/execute-build/test_apps/hi
94+
uname -m
95+
uname -a
96+
which gcc
97+
DISTRO=${{ matrix.distro }} \
98+
ARCH=${{ matrix.arch }} \
99+
EMULATED=${{ matrix.emulated }} \
100+
make docker-build
101+
artifact-directory: .github/workflows/execute-build/test_apps/hi/build
102+
artifact-name: build-artifacts-${{ matrix.distro }}-${{ matrix.arch }}
103+
retention-days: 1 # default
104+
artifactory-url: https://aerospike.jfrog.io # default
105+
artifactory-oidc-provider-name: gh-aerospike # default
106+
artifactory-oidc-audience: aerospike # default
107+
dry-run: false # default
108+
# the "package-built-artifacts" workflow is just an example of how one might package the built artifacts.
109+
# In this case it is using fpm to generate debs and rpms and uploading them to be processed further
110+
package-built-artifacts:
111+
needs: build-packages
112+
runs-on: ubuntu-22.04
113+
steps:
114+
- name: Checkout
115+
uses: actions/checkout@v4
116+
with:
117+
fetch-depth: 1
118+
- name: Download All Matrix Artifacts
119+
uses: actions/download-artifact@v4
120+
with:
121+
pattern: build-artifacts-*
122+
path: build-artifacts
123+
merge-multiple: true
124+
- name: Package Artifacts
125+
run: |
126+
.github/workflows/execute-build/test_apps/hi/package.sh --target hi --version v1.0.0 \
127+
--packages-dir build-artifacts --output-dir packaged-artifacts
128+
- name: Upload packaged Artifacts
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: packaged-artifacts
132+
path: packaged-artifacts
133+
retention-days: 1
134+
# upload:
135+
# needs: build-packages
136+
# uses: ./.github/workflows/reusable_upload-artifacts.yaml
137+
# with:
138+
# project: my-project
139+
# build-name: my-build
140+
# version: v1.0.0
141+
142+
# create-release-bundle:
143+
# needs: upload
144+
# uses: ./.github/workflows/reusable_create-release-bundle.yaml
145+
# with:
146+
# project: my-project
147+
# build-names: "my-build-deb,my-build-rpm"
148+
# bundle-name: my-release
149+
# version: v1.0.0

.github/workflows/execute-build/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ make clean && make all && mkdir -p dist && cp build/* dist/
103103
- Build script should create artifacts in the specified directory
104104
- No additional system dependencies (build script handles its own requirements)
105105

106-
## Notes
107-
108-
- Supports both inline commands and script files for maximum flexibility
109-
110106
## Testing
111107

112108
Run the test suite:
113109

114110
```bash
115111
.github/workflows/execute-build/test-entrypoint.sh
116112
```
113+
114+
## Notes on packaging
115+
116+
Packages should adhere to [standard aerospike naming conventions](https://aerospike.atlassian.net/wiki/spaces/~745351144/pages/4464574503/Aerospike+Package+Naming+Guidelines)
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Aerospike Package Naming Guidelines
2+
3+
## Overview
4+
5+
This document covers how we name our packages across different Linux distributions and architectures. We've established these conventions to keep things consistent and predictable.
6+
The naming patterns here work with standard DEB and RPM package tools, so they'll parse correctly with `dpkg-deb`, `rpm`, and other package management utilities.
7+
8+
## Canonical Fields
9+
10+
- **`<name>`** — Product SKU identifier, e.g., `aerospike-server-enterprise`, `aerospike-server-community`, `aerospike-tools`, `aerospike-client`.
11+
- **`<version>`** — Semantic version format: `X.Y.Z[.W]` (three or four components).
12+
- **`[tag]`** — Optional pre-release marker: any valid identifier that parses with standard DEB/RPM standards (e.g., `dev1`, `rc2`, `start28`, `beta3`).
13+
- **`<release>`** — Packaging release number (starts at `1` for GA releases; increments for packaging-only respins).
14+
- **`<distro>`** — Target distribution identifier (see tables below).
15+
- **`<arch>`** — Target architecture identifier (see table below).
16+
17+
## Package Naming Patterns
18+
19+
### DEB Package Format
20+
21+
```text
22+
{name}_{version}-{release}{distro}_{arch}.deb
23+
```
24+
25+
### RPM Package Format
26+
27+
```text
28+
{name}-{version}[_{tag}]-{release}.{distro}.{arch}.rpm
29+
```
30+
31+
**Note**: The `[tag]` portion is optional and can be any valid identifier that parses with standard DEB/RPM standards.
32+
33+
**Note**: Distribution is included in the filename for debian which extends beyond standard Debian/Ubuntu conventions, which usually handles distribution through repository structure.
34+
35+
## Distribution Identifiers
36+
37+
### Debian/Ubuntu (DEB)
38+
39+
| Distribution | Codename | Filename Token |
40+
| ------------ | -------- | -------------- |
41+
| Ubuntu 20.04 | focal | `ubuntu20.04` |
42+
| Ubuntu 22.04 | jammy | `ubuntu22.04` |
43+
| Ubuntu 24.04 | noble | `ubuntu24.04` |
44+
| Debian 11 | bullseye | `debian11` |
45+
| Debian 12 | bookworm | `debian12` |
46+
47+
### RHEL/EL & Amazon Linux (RPM)
48+
49+
| Distribution Family | Filename Token Examples |
50+
| ------------------- | ----------------------- |
51+
| RHEL/EL | `el8`, `el9` |
52+
| Amazon Linux | `amzn2023` |
53+
54+
## Architecture Identifiers
55+
56+
| Architecture | DEB Token | RPM Token |
57+
| ------------ | --------- | --------- |
58+
| x86-64 | `amd64` | `x86_64` |
59+
| ARM64 | `arm64` | `aarch64` |
60+
61+
## Examples
62+
63+
```text
64+
# Server packages
65+
aerospike-server-enterprise-8.1.0.0-1.el9.aarch64.rpm
66+
aerospike-server-enterprise_8.1.0.0-1debian12_amd64.deb
67+
68+
# Tools packages
69+
aerospike-tools-6.4.0-1.el9.x86_64.rpm
70+
aerospike-tools_6.4.0_ubuntu24.04_amd64.deb
71+
72+
# Other packages
73+
blastoid-6.4.0-1.amzn2023.aarch64.rpm
74+
blastoid_6.4.0_debian11_arm64.deb
75+
76+
# Custom tags
77+
aerospike-server-community-8.1.0.0-start28-1.el8.x86_64.rpm
78+
aerospike-server-community_8.1.0.0-start28_debian11_amd64.deb
79+
```
80+
81+
## Summary Rules
82+
83+
1. **Product Name First**: Always start with the product SKU identifier
84+
2. **Full Semantic Version**: Use complete version string (`X.Y.Z[.W]`)
85+
3. **Field Order**: version → (optional tag) → distro → arch
86+
4. **Format Consistency**:
87+
- DEB uses underscore separators (`_`)
88+
- RPM uses dash and dot separators (`-` and `.`)
89+
5. **Architecture Consistency**:
90+
- DEB: `amd64`/`arm64`
91+
- RPM: `x86_64`/`aarch64`
92+
6. **Release Numbering**: RPM packages use release number `1` for GA releases
93+
94+
## References
95+
96+
### DEB Package Naming
97+
98+
- **Debian Policy Manual**: [Package naming conventions](https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-version)
99+
- **Ubuntu Packaging Guide**: [Package versioning](https://packaging.ubuntu.com/html/packaging-new-software.html#versioning)
100+
- **dpkg-deb man page**: Package format and naming standards
101+
102+
### RPM Package Naming
103+
104+
- **RPM Packaging Guide**: [Package naming and versioning](https://rpm-packaging-guide.github.io/#package-naming)
105+
- **Fedora Packaging Guidelines**: [Package naming](https://docs.fedoraproject.org/en-US/packaging-guidelines/Naming/)
106+
- **rpm man page**: Package format and naming standards
107+
108+
### Semantic Versioning
109+
110+
- **SemVer 2.0.0**: [Semantic Versioning Specification](https://semver.org/)

0 commit comments

Comments
 (0)