mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 17:32:18 +00:00
COPR: Switch from hook to copr_cli (#5864)
This commit is contained in:
parent
a48df91737
commit
7ba593432e
41
.github/workflows/hook_copr.yml
vendored
41
.github/workflows/hook_copr.yml
vendored
@ -3,9 +3,7 @@ name: Trigger COPR build
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
secrets:
|
secrets:
|
||||||
COPR_HOOK_DAILY:
|
COPR_API_CONFIG:
|
||||||
COPR_HOOK_ALPHA:
|
|
||||||
COPR_HOOK_BETA:
|
|
||||||
inputs:
|
inputs:
|
||||||
copr_project:
|
copr_project:
|
||||||
description: COPR project to target
|
description: COPR project to target
|
||||||
@ -32,30 +30,13 @@ jobs:
|
|||||||
pip install requests
|
pip install requests
|
||||||
|
|
||||||
- name: Trigger COPR build
|
- name: Trigger COPR build
|
||||||
shell: python
|
uses: akdev1l/copr-build@main
|
||||||
run: |
|
id: copr_build
|
||||||
import requests
|
env:
|
||||||
|
COPR_API_TOKEN_CONFIG: ${{ secrets.COPR_API_CONFIG }}
|
||||||
project_name = "${{ inputs.copr_project }}"
|
with:
|
||||||
if project_name == "daily":
|
owner: meshtastic
|
||||||
hook_secret = "${{ secrets.COPR_HOOK_DAILY }}"
|
package-name: meshtasticd
|
||||||
project_id = 160277
|
project-name: ${{ inputs.copr_project }}
|
||||||
elif project_name == "alpha":
|
git-remote: "${{ github.server_url }}/${{ github.repository }}.git"
|
||||||
hook_secret = "${{ secrets.COPR_HOOK_ALPHA }}"
|
committish: ${{ github.sha }}
|
||||||
project_id = 160278
|
|
||||||
elif project_name == "beta":
|
|
||||||
hook_secret = "${{ secrets.COPR_HOOK_BETA }}"
|
|
||||||
project_id = 160279
|
|
||||||
else:
|
|
||||||
raise ValueError(f"Unknown COPR project: {project_name}")
|
|
||||||
|
|
||||||
webhook_url = f"https://copr.fedorainfracloud.org/webhooks/github/{project_id}/{hook_secret}/meshtasticd/"
|
|
||||||
copr_payload = {
|
|
||||||
"ref": "${{ github.ref }}",
|
|
||||||
"after": "${{ github.sha }}",
|
|
||||||
"repository": {
|
|
||||||
"clone_url": "${{ github.server_url }}/${{ github.repository }}.git",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
r = requests.post(webhook_url, json=copr_payload, headers={"X-GitHub-Event": "push"})
|
|
||||||
r.raise_for_status()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user