File tree 4 files changed +32
-18
lines changed
4 files changed +32
-18
lines changed Original file line number Diff line number Diff line change
1
+ .idea
2
+ * .iml
Original file line number Diff line number Diff line change 2
2
3
3
This action builds an validates Arch Linux package.
4
4
The ` PKGBUILD ` and ` .SRCINFO ` files should be under a subdirectory named the same as the ` pkgbuild ` of the package.
5
- This assumption is made so this action works well with [ aurpublish] .
5
+
6
+ This assumption made is so that this action works well with [ aurpublish] (_ untested in this fork yet_ ).
7
+
8
+ This version is a fork from the original [ arch-pkgbuild-builder] ( https://github.com/2m/arch-pkgbuild-builder ) .
9
+
10
+ It differs in that the ` PKGBUILD ` and related files do not need to be place in the root of the github workspace.
6
11
7
12
[ aurpublish ] : https://github.com/eli-schwartz/aurpublish
8
13
@@ -23,18 +28,18 @@ This assumption is made so this action works well with [aurpublish].
23
28
Verifies and builds the package.
24
29
25
30
``` yml
26
- uses : 2m /arch-pkgbuild-builder@v1
31
+ uses : grumlimited /arch-pkgbuild-builder@v1
27
32
with :
28
33
target : ' pkgbuild'
29
- pkgname : ' ucm-bin '
34
+ pkgname : ' data/arch/authenticator-rs/PKGBUILD '
30
35
` ` `
31
36
32
37
### srcinfo
33
38
34
39
Verifies if the ` .SRCINFO` is up to date with the `PKGBUILD`.
35
40
36
41
` ` ` yml
37
- uses: 2m /arch-pkgbuild-builder@v1
42
+ uses: grumlimited /arch-pkgbuild-builder@v1
38
43
with:
39
44
target: 'srcinfo'
40
45
pkgname: 'ucm-bin'
45
50
Installs the package and runs a given `command`.
46
51
47
52
` ` ` yml
48
- uses: 2m /arch-pkgbuild-builder@v1
53
+ uses: grumlimited /arch-pkgbuild-builder@v1
49
54
with:
50
55
target: 'run'
51
56
pkgname: 'ucm-bin'
56
61
57
62
So far this action is used by the following packages:
58
63
59
- * [ ucm-bin ] ( https://github.com/2m/ucm-bin-pkgbuild )
64
+ * [ authenticator-rs ] ( https://github.com/grumlimited/authenticator-rs )
Original file line number Diff line number Diff line change 1
1
name : ' Arch Linux PKGBUILD builder action'
2
2
description : ' Builds an validates PKGBUILD definition'
3
+
3
4
branding :
4
5
icon : ' triangle'
5
6
color : ' blue'
7
+
6
8
inputs :
7
- pkgname :
8
- description : ' The pkgname of the package to be validated '
9
+ pkgbuild :
10
+ description : ' Path to file PKGBUILD. Assumes to be placed in a directory with the name of package, ie /path/to/pkgname '
9
11
required : true
10
12
target :
11
13
description : ' Validation target. Can be one of: "pkgbuild", "srcinfo"'
@@ -14,10 +16,11 @@ inputs:
14
16
command :
15
17
description : ' Command to run after package installation'
16
18
required : false
19
+
17
20
runs :
18
21
using : ' docker'
19
22
image : ' Dockerfile'
20
23
args :
21
24
- ${{ inputs.target }}
22
- - ${{ inputs.pkgname }}
25
+ - ${{ inputs.pkgbuild }}
23
26
- ${{ inputs.command }}
Original file line number Diff line number Diff line change 1
1
#! /bin/sh -l
2
2
3
3
target=$1
4
- pkgname =$2
4
+ pkgbuild =$2
5
5
command=$3
6
6
7
- # '/github/workspace' is mounted as a volume and has owner set to root
8
- # set the owner to the 'build' user, so it can access package files
9
- sudo chown -R build /github/workspace /github/home
10
-
11
7
# assumes that package files are in a subdirectory
12
8
# of the same name as "pkgname", so this works well
13
9
# with "aurpublish" tool
14
- cd " $pkgname " || exit
10
+
11
+ pkgbuild_dir=$( dirname $( readlink $pkgbuild -f) )
12
+ cd $pkgbuild_dir || exit
13
+
14
+ # '/github/workspace' is mounted as a volume and has owner set to root
15
+ # set the owner to the 'build' user, so it can access package files
16
+ sudo chown -R build $pkgbuild_dir
17
+
18
+ pkgname=$( basename $pkgbuild_dir )
15
19
16
20
install_deps () {
17
21
# install make and regular package dependencies
18
22
grep -E ' depends|makedepends' PKGBUILD | \
19
23
sed -e ' s/.*depends=//' -e ' s/ /\n/g' | \
20
24
tr -d " '" | tr -d " (" | tr -d " )" | \
21
- xargs yay -S --noconfirm
25
+ xargs sudo yay -S --noconfirm
22
26
}
23
27
24
28
case $target in
@@ -27,8 +31,8 @@ case $target in
27
31
install_deps
28
32
makepkg --syncdeps --noconfirm
29
33
namcap " ${pkgname} " -*
30
- pacman -Qip " ${pkgname} " -*
31
- pacman -Qlp " ${pkgname} " -*
34
+ pacman -Qip " ${pkgname} " -* .xz
35
+ pacman -Qlp " ${pkgname} " -* .xz
32
36
;;
33
37
run)
34
38
install_deps
You can’t perform that action at this time.
0 commit comments