Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Improve autotag and build rpm again #1420

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
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
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/action-get-tag@v1.0.3
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
Loading