Skip to content

Commit

Permalink
chore: Improve autotag and build rpm again
Browse files Browse the repository at this point in the history
This should hopefully tag and have all the variables accessible without
issue.
  • Loading branch information
Venefilyn committed Nov 4, 2024
1 parent 02884cc commit 8f71d5e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/autotag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ jobs:
git config --local user.name "GitHub Actions"
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 }}
18 changes: 10 additions & 8 deletions .github/workflows/build-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
name: Build release RPMs

on:
workflow_run:
workflows: [Auto Tag]
types:
- completed
workflow_call:
inputs:
tag:
required: false
type: string
default: "v0.0.0"
push:
tags:
- v*
Expand All @@ -32,23 +34,23 @@ jobs:
uses: actions/checkout@v4

- name: Get tag
if: ${{ github.event_name != 'release' }}
if: startsWith(github.event.ref, 'refs/tags/')
id: tag
uses: devops-actions/[email protected]
with:
strip_v: true # Optional: Remove 'v' character from version
default: ${{ github.event.inputs.tag }} # Optional: Default version when tag not found
default: ${{ inputs.tag }} # Optional: Default version when tag not found

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

0 comments on commit 8f71d5e

Please sign in to comment.