Skip to content
Merged
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
19 changes: 12 additions & 7 deletions .github/workflows/fedora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ concurrency:

jobs:
build-rpm:
strategy:
fail-fast: false
matrix:
fedora_version: [43, 44]
runs-on: ubuntu-latest

permissions:
Expand All @@ -32,7 +36,7 @@ jobs:
artifact-metadata: write

container:
image: fedora:latest
image: fedora:${{ matrix.fedora_version }}
volumes:
- /usr:/usr-host
- /opt:/opt-host
Expand Down Expand Up @@ -99,7 +103,8 @@ jobs:
run: |
VERSION_PREFIX="${{ steps.version.outputs.ogc_version }}"
REPO="${OCI_REPO,,}"
EXISTING=$(oras repo tags "${REPO}" 2>/dev/null | { grep -cE "^${VERSION_PREFIX}\.[0-9]+$" || true; })
EXISTING=$(oras repo tags "${REPO}" 2>/dev/null || true)
EXISTING=$(echo "$EXISTING" | { grep -cE "^${VERSION_PREFIX}\.[0-9]+-fc${{ matrix.fedora_version }}$" || true; })
BUILD_NUM=$((EXISTING + 1))
echo "build_num=$BUILD_NUM" >> "$GITHUB_OUTPUT"
echo "Build number: $BUILD_NUM"
Expand Down Expand Up @@ -194,21 +199,21 @@ jobs:
cp "$TOPDIR"/RPMS/x86_64/*.rpm /tmp/rpms/ 2>/dev/null || true
cp "$TOPDIR"/RPMS/noarch/*.rpm /tmp/rpms/ 2>/dev/null || true
cd /tmp/rpms
DIGEST=$(oras push --format json "${REPO}:${VERSION}" ./*.rpm | jq -r '.digest')
DIGEST=$(oras push --format json "${REPO}:${VERSION}-fc${{ matrix.fedora_version }}" ./*.rpm | jq -r '.digest')
if [ -z "$DIGEST" ]; then
echo "::error::Failed to capture digest from oras push"
exit 1
fi
oras tag "${REPO}:${VERSION}" latest
oras tag "${REPO}:${VERSION}-fc${{ matrix.fedora_version }}" latest-fc${{ matrix.fedora_version }}
echo "digest=$DIGEST" >> "$GITHUB_OUTPUT"

- name: Sign artifacts
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION="${{ steps.version.outputs.ogc_version }}.${{ steps.buildnum.outputs.build_num }}"
REPO="${{ env.OCI_REPO }}"
cosign sign --yes "${REPO}:${VERSION}"
cosign sign --yes "${REPO}:latest"
cosign sign --yes "${REPO}:${VERSION}-fc${{ matrix.fedora_version }}"
cosign sign --yes "${REPO}:latest-fc${{ matrix.fedora_version }}"

- name: Attest build provenance
if: startsWith(github.ref, 'refs/tags/')
Expand All @@ -226,4 +231,4 @@ jobs:
cosign verify \
--certificate-identity-regexp=".*" \
--certificate-oidc-issuer="https://token.actions.githubusercontent.com" \
"${REPO}:${VERSION}"
"${REPO}:${VERSION}-fc${{ matrix.fedora_version }}"