From bc93d34d1665c818957512fb287ac6aec5925524 Mon Sep 17 00:00:00 2001 From: Christian Tosta <7252968+christiantosta@users.noreply.github.com> Date: Tue, 15 Jul 2025 04:18:47 -0300 Subject: [PATCH] [CI-CD] Updated workflows --- .copr/Makefile | 2 +- .github/workflows/ci.yml | 14 ++++++++------ .github/workflows/fedora.yml | 8 +++++--- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.copr/Makefile b/.copr/Makefile index 3e9b524..445f283 100644 --- a/.copr/Makefile +++ b/.copr/Makefile @@ -3,7 +3,7 @@ SHELL := bash source: - dnf -y install cmake gcc gcc-c++ + dnf -y install cmake gcc gcc-c++ openssl cmake --fresh -DBUILD_RPMS=ON -B build -S . cmake --build build --target srpm diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea6f488..ee9a2e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,6 @@ jobs: release-ci: runs-on: ubuntu-latest outputs: - version: ${{ steps.get_metadata.outputs.version }} tag: ${{ steps.get_metadata.outputs.tag }} to_release: ${{ steps.newtag.outputs.to_release }} @@ -20,15 +19,15 @@ jobs: - name: Install CI dependencies run: | sudo apt-get update - sudo apt-get -y -qq install cmake g++ gcc + sudo apt-get -y -qq install cmake openssl g++ gcc - name: Get latest package metadata id: get_metadata run: | cmake --fresh -B build -S . echo "tag=v$(cat build/version)" >> $GITHUB_OUTPUT - echo "version=$(cat build/version)" >> $GITHUB_OUTPUT - + echo "hash=$(sha256sum build/hash | sed 's/\s.*//g')" >> $GITHUB_OUTPUT + - name: Check if package version has corresponding git tag id: tagged shell: bash @@ -43,7 +42,11 @@ jobs: id: newtag if: steps.tagged.outputs.tagged == 0 run: | - git tag ${{ steps.get_metadata.outputs.tag }} \ + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git tag -a ${{ steps.get_metadata.outputs.tag }} \ + -m "New cert chain was released" \ + --trailer "SHA256:${{ steps.get_metadata.outputs.hash }}" \ && echo to_release=1 >> $GITHUB_OUTPUT \ && git push origin ${{ steps.get_metadata.outputs.tag }} \ || exit 0 @@ -53,6 +56,5 @@ jobs: uses: ./.github/workflows/fedora.yml with: containers: "['fedora:latest', 'fedora:41']" - version: ${{ needs.release-ci.outputs.version }} to_release: ${{ needs.release-ci.outputs.to_release }} tag: ${{ needs.release-ci.outputs.tag }} diff --git a/.github/workflows/fedora.yml b/.github/workflows/fedora.yml index acb7316..2c318a8 100644 --- a/.github/workflows/fedora.yml +++ b/.github/workflows/fedora.yml @@ -12,9 +12,6 @@ on: default: "0" required: false type: string - version: - required: true - type: string defaults: run: @@ -34,6 +31,7 @@ jobs: uses: actions/checkout@v4 - name: Prepare - install build dependencies + if: inputs.to_release == 1 run: | dnf -y install \ cmake \ @@ -46,18 +44,22 @@ jobs: tar - name: Prepare - setup RPM build tree + if: inputs.to_release == 1 run: | rpmdev-setuptree - name: Prepare - configure the source + if: inputs.to_release == 1 run: | cmake -B $(pwd)/build -S $(pwd) - name: Build - create source tarball and SRPM package + if: inputs.to_release == 1 run: | cmake --build $(pwd)/build --target srpm - name: Build - create RPM package + if: inputs.to_release == 1 run: | cmake --build $(pwd)/build --target rpms