forked from GarnetOS/Core
-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (130 loc) · 4.91 KB
/
01.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
name: 01 build
on:
repository_dispatch:
types: [run-another]
workflow_dispatch:
inputs:
package:
description: 'Config number'
required: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
strategy:
matrix:
arch: [armv6,armv7,aarch64,amd64,i386]
distro: [bullseye]
# include:
# - arch: riscv64
# distro: unstable
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Prepare host
run: |
sudo apt-get purge -y dotnet* gfortran gfortran* android-sdk
sudo apt install curl wget grep
sudo rm -r /usr/share/dotnet/ /usr/local/lib/android/sdk
curl https://dl.min.io/client/mc/release/linux-amd64/mc \
--create-dirs \
-o $HOME/minio-binaries/mc
chmod +x $HOME/minio-binaries/mc
export PATH=$PATH:$HOME/minio-binaries/
mc alias set myminio/ http://${{ secrets.MINIO_IP }}:9000 ${{ secrets.MINIO_ACCESS }} ${{ secrets.MINIO_SECRET }}
export CURR=$(([ -z "${{ github.event.inputs.package }}" ] && echo ${{github.event.client_payload.number}})||echo ${{ github.event.inputs.package }})
echo "CURR=$(($CURR))" >> $GITHUB_ENV
echo "PREV=$(($CURR-1))" >> $GITHUB_ENV
echo "NEXT=$(($CURR+1))" >> $GITHUB_ENV
- uses: actions/checkout@v4
name: Checkout
#- name: Download artifact
# uses: GarnetOS/action-download-artifact@node16
# with:
# workflow: prepare.yml
# name: out-${{matrix.arch}}-${{env.PREV}}
- name: Build
run: |
export PATH=$PATH:$HOME/minio-binaries/
mc cp myminio/bucket/out-${{matrix.arch}}.tar.gz out.tar.gz
- name: Prepare image
run: |
pwd
sudo ls
sudo apt install -y util-linux wget zip
sudo mkdir /mnt/lfs
tar -xvf out.tar.gz
sudo mount -o rw,acl,user_xattr,suid VHD.img /mnt/lfs
sudo ls
- uses: GarnetOS/run-on-arch-action@v2.1.2
name: Build in archtecture ${{matrix.arch}}
with:
arch: ${{matrix.arch}}
distro: ${{matrix.distro}}
setup: |
dockerRunArgs: |
--volume "/mnt/lfs:/mnt/lfs"
--volume "${PWD}/01:${PWD}/01"
run: |
uname -a
apt update
apt upgrade -y
apt install -y libicu67
apt install -y wget zip util-linux timelimit sudo
apt install -y gcc g++ gzip libc6 grep make patch perl python3 sed tar xz-utils binutils bison bzip2 coreutils diffutils findutils gawk texinfo flex
rm /bin/sh
ln -s /bin/bash /bin/sh
export LFS=/mnt/lfs
useradd -m -s /bin/bash lfs
sudo echo "lfs ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
chmod +x -R 01
cd 01
chown lfs prepare
export LC_ALL=POSIX
case $(uname -m) in
arm*) LFS_TGT=$(uname -m)-lfs-linux-gnueabihf ;;
*) LFS_TGT=$(uname -m)-lfs-linux-gnu ;;
esac
export LFS_TGT
PATH=/usr/bin
if [ ! -L /bin ]; then PATH=/bin:$PATH; fi
PATH=$LFS/tools/bin:$PATH
export PATH
export CONFIG_SITE=$LFS/usr/share/config.site
export MAKEFLAGS='-j2'
./timeout './${{env.CURR}}'
- name: Unmount
run: |
sudo umount /mnt/lfs
- name: Prepare image
run: |
tar -czvf out.tar.gz VHD.img
- uses: actions/upload-artifact@v3
with:
name: out-${{matrix.arch}}-${{env.CURR}}
path: out.tar.gz
- name: Rename
run: mv out.tar.gz out-${{matrix.arch}}.tar.gz
- name: Minio install and deploy
run: |
export PATH=$PATH:$HOME/minio-binaries/
mc cp out-${{matrix.arch}}.tar.gz myminio/bucket
post:
needs: build
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Prepare host
run: |
export CURR=$(([ -z "${{ github.event.inputs.package }}" ] && echo ${{github.event.client_payload.number}})||echo ${{ github.event.inputs.package }})
echo $CURR
echo "PREV=$(($CURR-1))" >> $GITHUB_ENV
echo "NEXT=$(($CURR+1))" >> $GITHUB_ENV
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.TOKEN }}
event-type: run-another
client-payload: '{"number": "${{ env.NEXT }}"}'