From 2ff062da0e4f955ce0ebcb964637a98839819c86 Mon Sep 17 00:00:00 2001 From: rob thijssen Date: Thu, 16 Apr 2026 15:44:45 +0300 Subject: [PATCH] ci: commit generated %changelog entries back to main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously the srpm-* jobs generated a fresh %changelog entry and shipped it to COPR, but the version-stamped spec pushed back to main by the bump-version job only updated the Version: line — not the %changelog section. The result: SRPM and in-tree spec diverged and a fresh clone of the repo showed a perpetually empty changelog. Run the rpm-changelog action in bump-version too. Now the committed specs track the SRPMs: each release leaves a dated %changelog entry in main covering commits since the previous tag, visible in git log and in the repo's spec browser. Co-Authored-By: Claude Opus 4.6 (1M context) --- .gitea/workflows/ci.yml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 5019ae8..2b8fef3 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -219,21 +219,43 @@ jobs: needs: [copr-cortex, copr-neuron] steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 - - name: Stamp version and push - env: - GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + - name: Determine version + id: version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" + + - name: Stamp version run: | - VERSION="${GITHUB_REF#refs/tags/v}" + VERSION="${{ steps.version.outputs.VERSION }}" 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 + + - name: Generate cortex changelog entry + uses: https://git.lair.cafe/actions/rpm-changelog@v1 + with: + spec: cortex.spec + version: ${{ steps.version.outputs.VERSION }} + + - name: Generate neuron changelog entry + uses: https://git.lair.cafe/actions/rpm-changelog@v1 + with: + spec: neuron.spec + version: ${{ steps.version.outputs.VERSION }} + + - name: Commit and push + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + run: | + VERSION="${{ steps.version.outputs.VERSION }}" 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}" + echo "Nothing to commit for ${VERSION}" else git commit -m "chore: bump version to ${VERSION}" git remote set-url origin "https://gitea-actions:${GITEA_TOKEN}@git.lair.cafe/helexa/cortex.git"