-
Notifications
You must be signed in to change notification settings - Fork 0
158 lines (136 loc) · 4.37 KB
/
lkms.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#
# Copyright (C) 2022 Ing <https://github.com/wjz304>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
name: Build lkms
on:
workflow_dispatch:
inputs:
version:
description: "format %y.%-m.$i or auto"
required: false
type: string
prerelease:
description: "pre release"
default: false
type: boolean
jobs:
build:
strategy:
matrix:
include:
- version: 7.1
platform: armada37xx
#- version: 7.1
# platform: armada38x
- version: 7.1
platform: rtd1296
- version: 7.1
platform: rtd1619b
- version: 7.2
platform: armada37xx
#- version: 7.2
# platform: armada38x
- version: 7.2
platform: rtd1296
- version: 7.2
platform: rtd1619b
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@main
- name: Checkout
uses: actions/checkout@main
with:
repository: RROrg/rr-lkms
token: ${{ secrets.RRORG }}
path: rrr-lkms
- 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: Make lkms
run: |
ROOT_PATH=${{ github.workspace }}
VERSION=${{ matrix.version }}
PLATFORM=${{ matrix.platform }}
. ${ROOT_PATH}/rrr-lkms/compile.sh
echo "makeEnvDeploy"
makeEnvDeploy "${ROOT_PATH}" "${VERSION}" "${PLATFORM}"
echo "makemodules"
makelkms "${ROOT_PATH}" "${VERSION}" "${PLATFORM}" "${ROOT_PATH}/rrr-lkms" "${ROOT_PATH}/output"
- name: Upload to Artifacts
uses: actions/upload-artifact@v4
with:
name: rp-lkms-${{ matrix.version }}-${{ matrix.platform }}
path: |
output/*
release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@main
- 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: Calculate version
run: |
# Calculate version
VERSION=""
if [ -n "${{ inputs.version }}" ]; then
if [ "$(echo ${{ inputs.version }} | cut -d '.' -f 1,2)" = "$(date +'%y.%-m')" ]; then
VERSION="${{ inputs.version }}"
else
LATEST_TAG="$(curl -skLH "Authorization: token ${{ secrets.RRORG }}" "https://api.github.com/repos/RROrg/rrr-lkms/releases" | jq -r ".[0].tag_name" 2>/dev/null)"
if [ -n "${LATEST_TAG}" -a "$(echo ${LATEST_TAG} | cut -d '.' -f 1,2)" = "$(date +'%y.%-m')" ]; then # format %y.%-m.$i
VERSION="$(echo ${LATEST_TAG} | awk -F '.' '{$3=$3+1}1' OFS='.')"
else
VERSION="$(date +'%y.%-m').0"
fi
fi
else
VERSION=""
fi
echo "VERSION: ${VERSION}"
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: download to artifacts
uses: actions/download-artifact@v4
with:
path: output
pattern: rp-lkms-*
merge-multiple: true
- name: delete-artifact
uses: geekyeggo/delete-artifact@v5
with:
name: |
rp-lkms-*
- name: Zip lkms
run: |
VERSION="${{ env.VERSION }}"
VERSION="${VERSION:-"test"}"
echo "${VERSION}" > "output/VERSION"
zip -9 rp-lkms-${VERSION}.zip -j output/*
- name: Upload to Artifacts
if: success() && env.VERSION == ''
uses: actions/upload-artifact@v4
with:
name: rp-lkms
path: |
rp-lkms*.zip
retention-days: 5
- name: Release
if: success() && env.VERSION != ''
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VERSION }}
prerelease: ${{ inputs.prerelease }}
artifacts: rp-lkms*.zip
owner: RROrg
repo: rrr-lkms
token: ${{ secrets.RRORG }}