-
-
Notifications
You must be signed in to change notification settings - Fork 83
103 lines (96 loc) · 3.06 KB
/
Copy pathvalidate-package.yml
File metadata and controls
103 lines (96 loc) · 3.06 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
name: Linting
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
validation:
name: Validate package
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false
- name: Validate PKGBUILD
id: validate-pkgbuild
uses: 2m/arch-pkgbuild-builder@1e857b7a8cd3e37b29898833363bab7e621cdd7b # v1.21
with:
target: "pkgbuild"
pkgname: "gitkraken-aur"
- name: Validate SRCINFO
id: validate-srcinfo
uses: 2m/arch-pkgbuild-builder@1e857b7a8cd3e37b29898833363bab7e621cdd7b # v1.21
with:
target: "srcinfo"
pkgname: "gitkraken-aur"
sources:
name: Verify ${{ matrix.arch }} source
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
steps:
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
persist-credentials: false
- name: Verify source URL, checksum, and layout
run: |
set -euo pipefail
cd gitkraken-aur
# shellcheck disable=SC1091
source PKGBUILD
arch="${{ matrix.arch }}"
declare -n src="source_${arch}"
declare -n sums="sha256sums_${arch}"
url="${src[0]#*::}"
expected="${sums[0]}"
echo "Arch: ${arch}"
echo "URL: ${url}"
echo "Expected: ${expected}"
curl -fsSL "${url}" -o pkg.tar.gz
actual="$(sha256sum pkg.tar.gz | cut -d' ' -f1)"
echo "Actual: ${actual}"
if [[ "${actual}" != "${expected}" ]]; then
echo "::error::Checksum mismatch for ${arch} (${actual} != ${expected})"
exit 1
fi
contents="$(tar tzf pkg.tar.gz)"
for entry in gitkraken/gitkraken gitkraken/gitkraken.png; do
if ! grep -qx "${entry}" <<<"${contents}"; then
echo "::error::Expected ${entry} missing from ${arch} tarball"
exit 1
fi
done
echo "OK: ${arch} source verified"
linter:
name: Code Base
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
# To report GitHub Actions status checks
statuses: write
steps:
- name: Checkout Code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
persist-credentials: false
- name: Lint Code Base
uses: super-linter/super-linter/slim@4ce20838b8ab83717e78138c5b3a1407148e0918
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_HTML: false
VALIDATE_HTML_PRETTIER: false
VALIDATE_BIOME_FORMAT: false
VALIDATE_BIOME_LINT: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}