-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
70 lines (64 loc) · 2.1 KB
/
action.yaml
File metadata and controls
70 lines (64 loc) · 2.1 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: "agr"
description: Build Arch packages for multiple OS platforms.
inputs:
url:
description: Git URL to load PKGBUILD from
default: ${{ github.server_url }}/${{ github.repository }}.git
package:
description: List of space-separated package names to build
required: true
skippgpcheck:
description: Skip PGP check
default: false
type: boolean
skipinteg:
description: Skip integrity check
default: false
type: boolean
skipchecksum:
description: Skip checksum
default: false
type: boolean
ignorearch:
description: Ignore architecture
default: false
type: boolean
os:
description: OS to build packages for
type: choice
options:
- alarm-aarch64
- alarm-armv7h
- arch-x86_64
default: arch-x86_64
runs:
using: "composite"
steps:
- name: Build
shell: bash
run: |
WORKDIR="/tmp/agr"
mkdir -p "$WORKDIR"
DOCKERFILE="Dockerfile.${{ inputs.os }}"
curl -fsSL "https://raw.githubusercontent.com/hbiyik/agr/master/$DOCKERFILE" -o "$WORKDIR/$DOCKERFILE"
packages='${{ inputs.package }}'
# agr flags
FLAGS=""
[ "${{ inputs.skippgpcheck }}" = "true" ] && FLAGS="$FLAGS --skippgpcheck"
[ "${{ inputs.skipinteg }}" = "true" ] && FLAGS="$FLAGS --skipinteg"
[ "${{ inputs.ignorearch }}" = "true" ] && FLAGS="$FLAGS --ignorearch"
[ "${{ inputs.skipchecksum }}" = "true" ] && FLAGS="$FLAGS --skipchecksum"
# Build the Docker image
docker build -t agr-build -f "$WORKDIR/$DOCKERFILE" .
# Run the container
docker run --rm \
-v "${GITHUB_WORKSPACE}:/work" \
-e PACKAGE="$packages" \
agr-build bash -c "\
mkdir -p /work/agr && \
chown -R user /work/agr && \
rm -rf /home/user/.agr && \
ln -sf /work/agr /home/user/.agr && \
sudo -u user agr rem set repo ${{ inputs.url }} && \
sudo -u user agr sync --pkg=\${PACKAGE// /,} --noconfirm $FLAGS && \
sudo -u user agr build \$PACKAGE --noconfirm $FLAGS"