forked from onkelbeh/HomeAssistantRepository
-
Notifications
You must be signed in to change notification settings - Fork 1
31 lines (29 loc) · 1.37 KB
/
Copy pathcreate-ebuild.yaml
File metadata and controls
31 lines (29 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
name: Create ebuild
on:
workflow_dispatch:
push:
branches: feature/*/*
jobs:
genebuild:
runs-on: ubuntu-latest
steps:
# synchronys my own git
- name: Checkout code
uses: actions/checkout@v7
- name: Get branch
run: |
full_package=${GITHUB_REF#refs/heads/feature/}
category=$( echo $full_package | cut -d/ -f1 )
package=$( echo $full_package | cut -d/ -f2 | sed 's/-[0-9].*//' )
version=$( echo $full_package | sed "s/${category}\\/${package}-//" )
cd ${category}/${package}
github_src=$( grep 'type="github"' metadata.xml | cut -d\> -f2 | cut -d\< -f 1 )
cp $(ls -vr *.ebuild | head -n1) ${package}-${version}.ebuild
buildsys=$( grep DISTUTILS_USE_PEP517 ${package}-${version}.ebuild | cut -d= -f2)
if [ "${buildsys}" = "setuptools" ]; then
elif [ "${buildsys}" = "poetry" ]; then
wget https://raw.githubusercontent.com/${github_src}/refs/tags/${version}/pyproject.toml
tail --lines=+$(grep -n '\[tool.poetry.dependencies\]' pyproject.toml | cut -d: -f1) pyproject.toml | tail --lines=+2 > tmp_deps
head --lines=$( grep -n '^\[' tmp_deps |head -n1 | cut -d: -f1 ) tmp_deps | head --lines=-1 > deps
rm pyproject.toml tmp_deps
fi