From 5679559947e9a33fdbb003be6ccb9064767b9fd9 Mon Sep 17 00:00:00 2001 From: Freya Gustavsson Date: Fri, 11 Oct 2024 20:04:38 +0200 Subject: [PATCH] chore: change workflow userpass --- .github/workflows/build-rpm.yml | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-rpm.yml b/.github/workflows/build-rpm.yml index bbf618bfc..d1baa57b2 100644 --- a/.github/workflows/build-rpm.yml +++ b/.github/workflows/build-rpm.yml @@ -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: @@ -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 @@ -36,7 +39,7 @@ 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" @@ -44,23 +47,27 @@ jobs: 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: @@ -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: