ci: add RPM packaging for cortex and neuron

- cortex.spec: gateway binary, cortex.service systemd unit,
  cortex.toml + models.toml config files
- neuron.spec: neuron binary, neuron.service systemd unit,
  neuron.toml config file
- Parallel CI: srpm-cortex and srpm-neuron jobs build SRPMs
  concurrently, then publish to separate COPR repos
  (helexa/cortex and helexa/neuron)
- bump-version job: after both COPR publishes succeed, stamps
  tag version into Cargo.toml, specs, Cargo.lock and pushes
  to main via GITEA_TOKEN
- Shared cortex user/group across both packages
- Example configs: cortex.example.toml, neuron.example.toml,
  models.example.toml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 16:24:18 +03:00
parent c85d50066e
commit 324dfa05c5

View File

@@ -134,7 +134,6 @@ jobs:
name: Publish cortex to COPR
runs-on: fedora
needs: srpm-cortex
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download SRPM
uses: actions/download-artifact@v3
@@ -153,7 +152,6 @@ jobs:
name: Publish neuron to COPR
runs-on: fedora
needs: srpm-neuron
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Download SRPM
uses: actions/download-artifact@v3
@@ -167,3 +165,29 @@ jobs:
- name: Submit build to COPR
run: copr-cli build helexa/neuron *.src.rpm
bump-version:
name: Bump version in source
runs-on: fedora
needs: [copr-cortex, copr-neuron]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GITEA_TOKEN }}
- name: Stamp version and push
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
sed -i '/\[workspace\.package\]/,/\[/{ s/^version = ".*"/version = "'"${VERSION}"'"/ }' Cargo.toml
sed -i "s/^Version:.*/Version: ${VERSION}/" cortex.spec
sed -i "s/^Version:.*/Version: ${VERSION}/" neuron.spec
cargo check --workspace 2>/dev/null || true
git config user.name "Gitea Actions"
git config user.email "actions@git.lair.cafe"
git add Cargo.toml Cargo.lock cortex.spec neuron.spec
if git diff --cached --quiet; then
echo "Version already at ${VERSION}"
else
git commit -m "chore: bump version to ${VERSION}"
git push origin HEAD:main
fi