-
Notifications
You must be signed in to change notification settings - Fork 1
193 lines (171 loc) · 8.29 KB
/
Copy pathupdate-kernel-version.yml
File metadata and controls
193 lines (171 loc) · 8.29 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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Update Kernel Version and Build Package
on:
workflow_dispatch:
schedule:
- cron: '0 */1 * * *'
push:
branches: [ "*" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Translator Dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install \
build-essential \
cmake \
fakeroot \
git \
libarchive-dev \
libarchive-tools \
libcurl4-openssl-dev \
libgpgme-dev \
libssl-dev \
zip \
python3-pip
sudo pip3 install meson
sudo pip3 install ninja
- name: install pacman
shell: bash
env:
PACMAN_VERSION: 6.0.1
run: |
sudo git clone --depth 1 https://gitlab.manjaro.org/packages/core/pacman.git
pushd pacman
sudo wget https://sources.archlinux.org/other/pacman/pacman-${PACMAN_VERSION}.tar.xz
sudo tar -xvf pacman-${PACMAN_VERSION}.tar.xz
pushd pacman-${PACMAN_VERSION}
#sudo patch -p1 -i ../pacman-sync-first-option.patch
sudo meson --prefix=/usr \
--buildtype=plain \
-Ddoc=disabled \
-Ddoxygen=enabled \
-Dscriptlet-shell=/usr/bin/bash \
-Dldconfig=/usr/bin/ldconfig \
build
sudo meson compile -C build
sudo meson install -C build
popd
sudo install -m644 pacman.conf /etc/pacman.conf
sudo install -m644 makepkg.conf /etc/
sudo mkdir -p /etc/pacman.d
sudo touch /etc/pacman.d/mirrorlist
popd
sudo rm -rf pacman
#add biglinux repository
sudo sed -i '/\[core\]/{h;s/.*/\[biglinux-update-stable\]/;p;x;}' /etc/pacman.conf
sudo sed -i '/\[core\]/{h;s/.*/SigLevel = PackageRequired/;p;x;}' /etc/pacman.conf
sudo sed -i '/\[core\]/{h;s/.*/Server = https:\/\/repo.biglinux.com.br\/update-stable\/$arch/;p;x;}' /etc/pacman.conf
sudo sed -i '/\[core\]/{h;s/.*//;p;x;}' /etc/pacman.conf
echo '
[biglinux-testing]
SigLevel = PackageRequired
Server = https://repo.biglinux.com.br/testing/$arch' | sudo tee -a /etc/pacman.conf
echo '
[biglinux-stable]
SigLevel = PackageRequired
Server = https://repo.biglinux.com.br/stable/$arch' | sudo tee -a /etc/pacman.conf
#Mirrorlist
# echo 'Server = https://mnvoip.mm.fcix.net/manjaro/stable/$repo/$arch' | sudo tee -a /etc/pacman.d/mirrorlist
echo 'Server = https://mirrors2.manjaro.org/stable/$repo/$arch' | sudo tee /etc/pacman.d/mirrorlist
sudo sed -i '/DownloadUser =/d' /etc/pacman.conf
- name: install keyrings
shell: bash
run: |
sudo install -dm755 /usr/share/pacman/keyrings/
sudo git clone --depth 1 https://gitlab.manjaro.org/packages/core/manjaro-keyring.git
pushd manjaro-keyring
sudo install -m0644 manjaro.gpg /usr/share/pacman/keyrings/
sudo install -m0644 manjaro-trusted /usr/share/pacman/keyrings/
sudo install -m0644 manjaro-trusted /usr/share/pacman/keyrings/
popd
sudo rm -rf manjaro-keyring
mkdir -p archlinux-keyring
pushd archlinux-keyring
wget https://archlinux.org/packages/core/any/archlinux-keyring/download -O /tmp/archlinux-keyring.tar.zst
tar --use-compress-program=unzstd --strip-components=4 --wildcards -xvf /tmp/archlinux-keyring.tar.zst usr/share/pacman/keyrings/*
sudo install -m0644 archlinux.gpg /usr/share/pacman/keyrings/
sudo install -m0644 archlinux-trusted /usr/share/pacman/keyrings/
sudo install -m0644 archlinux-revoked /usr/share/pacman/keyrings/
popd
sudo rm -rf archlinux-keyring
sudo git clone --depth 1 https://github.com/biglinux/biglinux-keyring.git
pushd biglinux-keyring
sudo install -m0644 biglinux.gpg /usr/share/pacman/keyrings/
sudo install -m0644 biglinux-trusted /usr/share/pacman/keyrings/
sudo install -m0644 biglinux-trusted /usr/share/pacman/keyrings/
popd
sudo rm -rf biglinux-keyring
#sudo pacman-key --init
#sudo pacman-key -r 45EC44879815E2A6
#sudo pacman-key --lsign-key 45EC44879815E2A6
#sudo pacman-key --populate archlinux manjaro biglinux
- name: pull keys
shell: bash
run: |
sudo git clone https://github.com/biglinux/biglinux-key.git
sudo mkdir -p /etc/pacman.d/gnupg/
sudo cp -r biglinux-key/usr/share/pacman/keyrings/* /etc/pacman.d/gnupg/
sudo rm -r biglinux-key
sudo pacman -Sy
# # Tmate ##
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
- name: Update Kernel Version
shell: bash
run: |
lastStable=$(pacman -Sl | grep linux[0-9] | grep core | grep -vE "rc|headers|rt" | awk '{print $3}' | sed 's/-.*//' | sort -Vr | head -1)
#| awk -F '.' '$NF > 2'
kernelVer=$(awk -F '.' '{print $1$2}' <<< $lastStable)
kernelRel=$(pacman -Sl | grep linux$kernelVer | grep core | grep -vE "rc|headers|rt" | awk -F '-' '{print $2}')
kVerRepo=${lastStable}-${kernelRel}
# pkgverRepo=$(pacman -Sl | grep linux[0-9] | grep core | grep -vE "rc|headers|rt" | sort | tail -n1 | cut -d " " -f3 | cut -d "-" -f1)
# pkgverfinal=$(pacman -Sl | grep linux[0-9] | grep core | grep -vE "rc|headers|rt" | sort | tail -n1 | cut -d " " -f3 | cut -d "-" -f1 | rev | cut -d "." -f1 | rev)
# kernelverRepo=$(pacman -Sl | grep linux[0-9] | grep core | grep -vE "rc|headers|rt" | sort | tail -n1 | cut -d " " -f2 | sed 's/linux//')
# pkgrelRepo=$(pacman -Sl | grep linux[0-9] | grep core | grep -vE "rc|headers|rt" | sort | tail -n1 | cut -d " " -f3 | cut -d "-" -f2)
# kVerRepo=${pkgverRepo}-${pkgrelRepo}
cancel () {
echo "Sem atualiza de versão"
echo "SAINDO...."
curl -s -H "Authorization: token ${{ github.token }}" \
-X POST "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel"
sleep infinity
}
source PKGBUILD
kVerBig=${pkgver}-${pkgrel}
if [ "$kVerRepo" != "$kVerBig" ];then
sed -i "s/pkgver=.*/pkgver=${lastStable}/" PKGBUILD
sed -i "s/kernelver=.*/kernelver=${kernelVer}/" PKGBUILD
sed -i "s/pkgrel=.*/pkgrel=${kernelRel}/" PKGBUILD
else
cancel
fi
# if [ "$kVerRepo" != "$kVerBig" ];then
# if [ "$pkgverfinal" -ge "3" ]; then
# sed -i "s/pkgver=.*/pkgver=${pkgverRepo}/" PKGBUILD
# sed -i "s/kernelver=.*/kernelver=${kernelverRepo}/" PKGBUILD
# sed -i "s/pkgrel=.*/pkgrel=${pkgrelRepo}/" PKGBUILD
# else
# cancel
# fi
# else
# cancel
# fi
- name: Update github
run: |
kVerRepo=$(pacman -Sl | grep linux[0-9] | grep core | grep -vE "rc|headers|rt" | awk '{print $3}' | sed 's/-.*//' | sort -Vr | head -1)
git config --local user.email "${{ secrets.GIT_USER }}@users.noreply.github.com"
git config --local user.name "${{ secrets.GIT_USER }}"
if [ -n "$(git commit -m "$kVerRepo" -a | grep "nothing to commit")" ];then exit 0; fi
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Send Hooks BigLinux Build Package
shell: bash
run: |
curl -X POST -H "Accept: application/json" -H "Authorization: token ${{ secrets.WEBHOOK_TOKEN }}" --data '{"event_type": "${{ github.repository }}", "client_payload": { "branch": "${{ github.ref_name }}", "url": "https://github.com/${{ github.repository }}", "version": "1.2.3"}}' https://api.github.com/repos/BigLinux-Package-Build/build-package/dispatches