Skip to content

Commit

Permalink
chore: change workflow userpass
Browse files Browse the repository at this point in the history
  • Loading branch information
Venefilyn committed Oct 11, 2024
1 parent e082fb9 commit 5679559
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions .github/workflows/build-rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ on:
tag:
description: "Custom tag for release, e.g. v1.2.3-1234"
required: false
default: ""
default: "v0.0.0"

env:
REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }}
REGISTRY_USER: ${{ github.repository_owner }}
REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}

jobs:
Expand All @@ -27,6 +27,9 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Display downloaded files
run: ls -la

- name: Get tag
if: ${{ github.event_name != 'release' }}
id: tag
Expand All @@ -36,31 +39,35 @@ jobs:
default: ${{ github.event.inputs.tag }} # Optional: Default version when tag not found

- name: Update specfile to match tag
if: ${{ github.event_name != 'release' || steps.tag.outputs.tag != '' }}
if: ${{ github.event_name != 'release' && steps.tag.outputs.tag != 'v0.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 != '' }}
if: ${{ github.event_name != 'release' && steps.tag.outputs.tag != 'v0.0.0' }}
uses: jacobtomlinson/gha-find-replace@v3
with:
include: "convert2rhel/__init__.py"
find: "(__version__ += +).*"
replace: '${1}\"${{steps.tag.outputs.tag}}\"'
replace: '${1}"${{steps.tag.outputs.tag}}"'

- uses: actions/upload-artifact@v4
- name: Upload tar file
uses: actions/upload-artifact@v4
with:
name: github-repo
path: "."
path: |
packaging/convert2rhel.spec
convert2rhel/__init__.py
retention-days: 1
include-hidden-files: true

build_rpms:
needs:
- setup_version
name: Build EL${{ matrix.el.ver }} RPM
name: Build RPM
strategy:
fail-fast: false
matrix:
Expand All @@ -70,10 +77,16 @@ jobs:
- ver: 9
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
name: github-repo

- name: Display downloaded files
run: ls -la

- name: Login to ghcr.io
uses: redhat-actions/podman-login@v1
with:
Expand Down

0 comments on commit 5679559

Please sign in to comment.