-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Split autotag and build RPM dependency
Should determine the tag on its own without having to deal with sending it back and forth. Hopefully this works.
- Loading branch information
Showing
2 changed files
with
11 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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* | ||
|
@@ -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" | ||
|