Skip to content

Commit

Permalink
chore: Split autotag and build RPM dependency
Browse files Browse the repository at this point in the history
Should determine the tag on its own without having to deal with sending
it back and forth. Hopefully this works.
  • Loading branch information
Venefilyn committed Nov 4, 2024
1 parent 8f71d5e commit 2f31e3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 18 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/autotag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,5 @@ jobs:
git tag ${{ steps.determine_tag.outputs.tag }}
git push origin ${{ steps.determine_tag.outputs.tag }}
- name: Call build RPM workflow
uses: oamg/convert2rhel/.github/workflows/build-rpm.yml@main
with:
tag: ${{ steps.determine_tag.outputs.tag }}
call-build-rpms:
uses: oamg/convert2rhel/.github/workflows/build-rpm.yml@main
23 changes: 9 additions & 14 deletions .github/workflows/build-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
name: Build release RPMs

on:
workflow_call:
inputs:
tag:
required: false
type: string
default: "v0.0.0"
workflow_run:
workflows: [Auto Tag]
types:
- completed
push:
tags:
- v*
Expand All @@ -33,24 +31,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Get tag
if: startsWith(github.event.ref, 'refs/tags/')
- name: Determine tag
id: tag
uses: devops-actions/[email protected]
with:
strip_v: true # Optional: Remove 'v' character from version
default: ${{ inputs.tag }} # Optional: Default version when tag not found
run: |
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
- name: Update specfile to match tag
if: startsWith(github.event.ref, 'refs/tags/') && ${{ steps.tag.outputs.tag != '0.0.0' }}
if: startsWith(github.event.ref, 'refs/tags/')
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "packaging/convert2rhel.spec"
find: "(Version: +).*"
replace: "${1}${{steps.tag.outputs.tag}}"

- name: Update convert2rhel version to match tag
if: startsWith(github.event.ref, 'refs/tags/') && ${{ steps.tag.outputs.tag != '0.0.0' }}
if: startsWith(github.event.ref, 'refs/tags/')
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "convert2rhel/__init__.py"
Expand Down

0 comments on commit 2f31e3c

Please sign in to comment.