-
Notifications
You must be signed in to change notification settings - Fork 18
83 lines (70 loc) · 2.32 KB
/
build.yml
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
#
# Copyright (C) 2022 Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build
on:
workflow_dispatch:
inputs:
version:
description: "format %y.%-m.$i or auto"
required: false
type: string
jobs:
build:
strategy:
matrix:
arch: [ x64-7.0, x64-7.2, aarch64-7.0, aarch64-7.2 ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
swap-storage: false
- name: Init Env
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
sudo timedatectl set-timezone "Asia/Shanghai"
- name: Checkout SynoCommunity Source and Docker Image
run: |
docker pull ghcr.io/synocommunity/spksrc
git clone --depth=1 https://github.com/SynoCommunity/spksrc.git
cp -rf src/* spksrc
- name: Build Package
run: |
ARCH="${{ matrix.arch }}"
ROOT_PATH="${{ github.workspace }}"
docker run -v ${ROOT_PATH}/spksrc:/spksrc -w /spksrc/spk/rr-iptables ghcr.io/synocommunity/spksrc make "arch-${ARCH}"
if [ ! -f spksrc/spk/rr-iptables/work-${ARCH}/package.tgz ]; then
echo "${ARCH} build error!"
exit 1
fi
mkdir -p ${ROOT_PATH}/modules
tar -zxf spksrc/spk/rr-iptables/work-${ARCH}/package.tgz -C ${ROOT_PATH}/modules ./lib
- name: Pack
run: |
ROOT_PATH="${{ github.workspace }}"
mkdir -p ${ROOT_PATH}/output
for I in $(find ./modules -name "*.ko"); do zip -9 ./output/$(echo ${I} | cut -d/ -f5).zip -j ${I}; done
- name: Upload to Artifacts
if: success()
uses: actions/upload-artifact@v4
with:
name: modules-${{ matrix.arch }}
path: |
output/*.zip
retention-days: 5
- name: Release
if: success() && inputs.version != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ inputs.version }}
artifacts: |
output/*.zip
body: |
- Editing ...