Skip to content

Commit

Permalink
Added COPR upload Action
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikReider committed May 4, 2024
1 parent bb87ff8 commit ed370d8
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/copr_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check build for Fedora.
name: Build RPMs

on:
push:
Expand All @@ -14,7 +14,7 @@ on:
workflow_dispatch:

jobs:
build:
RPM-build:
strategy:
fail-fast: false
matrix:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/copr_upload.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Package for Copr repo

on:
push:
paths:
- COPR/**
branches: [main]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
upload-copr:
strategy:
fail-fast: false
matrix:
pkgname: [ swayfx, scenefx ]

container: fedora:latest
runs-on: ubuntu-latest
needs: RPM-build
steps:
- name: Install API token for copr-cli
env:
# To generate a new token: https://copr.fedorainfracloud.org/api/.
API_LOGIN: ${{ secrets.COPR_API_LOGIN }}
API_USERNAME: ${{ secrets.COPR_API_USERNAME }}
API_TOKEN_CONTENT: ${{ secrets.COPR_API_TOKEN }}
run: |
mkdir -p "$HOME/.config"
# To generate a new token: https://copr.fedorainfracloud.org/api/.
echo "[copr-cli]" >> "$HOME/.config/copr"
echo "login = $API_LOGIN" >> "$HOME/.config/copr"
echo "username = $API_USERNAME" >> "$HOME/.config/copr"
echo "token = $API_TOKEN_CONTENT" >> "$HOME/.config/copr"
echo "copr_url = https://copr.fedorainfracloud.org" >> "$HOME/.config/copr"
- name: Install dependencies
run: |
dnf -y install copr-cli
- name: Check out sources
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Submit the build to copr
run: |
cd COPR/${{matrix.pkgname}}
rpkg -v copr-build -w ${{ secrets.COPR_REPO_NAME }}

0 comments on commit ed370d8

Please sign in to comment.