Skip to content

Commit

Permalink
Add setup-copr-cli action
Browse files Browse the repository at this point in the history
  • Loading branch information
kwk committed Feb 5, 2024
1 parent dc2148e commit ff3b717
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
17 changes: 3 additions & 14 deletions .github/actions/promote-snapshot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,9 @@ inputs:
runs:
using: "composite"
steps:
- name: Setup Copr config file
shell: bash -e {0}
env:
# You need to have those secrets in your repo.
# See also: https://copr.fedorainfracloud.org/api/.
COPR_CONFIG_FILE: ${{ secrets.copr-config }}
run: |
mkdir -p ~/.config
printf "$COPR_CONFIG_FILE" > ~/.config/copr
- name: Install Copr CLI and required tools
shell: bash -e {0}
run: |
dnf install -y copr-cli make bzip2 rpm-build pcre2-tools jq
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-copr-cli
with:
copr-config: ${{ secrets.copr-config }}
- name: "Check if source project exists and all builds succeeded"
shell: bash -e {0}
run: |
Expand Down
24 changes: 24 additions & 0 deletions .github/actions/setup-copr-cli/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# See https://docs.github.com/en/actions/creating-actions/creating-a-composite-action#creating-an-action-metadata-file

name: "Setup copr"
description: "Installs Copr CLI and required tools"
inputs:
copr-config:
description: "The secret copr configuration found here https://copr.fedorainfracloud.org/api/"
required: true
runs:
using: "composite"
steps:
- name: Setup Copr config file
shell: bash -e {0}
env:
# You need to have those secrets in your repo.
# See also: https://copr.fedorainfracloud.org/api/.
COPR_CONFIG_FILE: ${{ secrets.copr-config }}
run: |
mkdir -p ~/.config
printf "$COPR_CONFIG_FILE" > ~/.config/copr
- name: Install Copr CLI and required tools
shell: bash -e {0}
run: |
dnf install -y copr-cli make bzip2 rpm-build pcre2-tools jq
17 changes: 4 additions & 13 deletions .github/workflows/fedora-copr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,12 @@ jobs:
runs-on: ubuntu-latest
container: fedora:38
steps:
- name: Setup Copr config file
env:
# You need to have those secrets in your repo.
# See also: https://copr.fedorainfracloud.org/api/.
COPR_CONFIG_FILE: ${{ secrets.COPR_CONFIG }}
run: |
mkdir -p ~/.config
printf "$COPR_CONFIG_FILE" > ~/.config/copr
- name: Install Copr CLI and required tools
run: |
dnf install -y copr-cli make bzip2 rpm-build pcre2-tools jq
- uses: actions/checkout@v4

- uses: ./.github/actions/setup-copr-cli
with:
copr-config: ${{ secrets.COPR_CONFIG }}

- name: "Variables and functions"
shell: bash -e {0}
run: |
Expand Down

0 comments on commit ff3b717

Please sign in to comment.