Repository navigation
82 lines (75 loc) · 3.52 KB
/
Copy pathmain.yml
File metadata and controls
82 lines (75 loc) · 3.52 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
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the $default-branch branch
push:
branches: [ dc-master ]
pull_request:
branches: [ dc-master ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# 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:
# The type of runner that the job will run on
runs-on: self-hosted
env:
http_proxy: "http://10.10.3.72:7890"
https_proxy: "http://10.10.3.72:7890"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout dc-master
uses: actions/checkout@v4
with:
ref: dc-master
path: dc-linux
# Runs a set of commands using the runners shell
- name: build-linux
id: build-linux
run: |
sudo docker ps
pwd
sudo docker run --rm --name build-linux-$GITHUB_RUN_ID \
--privileged=true -v /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/dc-linux:/home \
main-linux:v2 \
/bin/bash -c "
cd /home
apt-get update
apt install -y debhelper libdw-dev libelf-dev rsync
export ARCH=riscv
export INSTALL_MOD_PATH=/home
export CROSS_COMPILE=/usr/bin/riscv64-linux-gnu-
make defconfig
make -j$(nproc)
DEB_BUILD_PROFILES=pkg.linux-upstream.nokernelheaders make -j$(nproc) bindeb-pkg
make modules_install
mv ../*.deb .
"
sudo chown -R gitlab-runner:gitlab-runner /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/dc-linux
sudo chmod -R 755 /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/dc-linux
- name: send-mail
if: ${{ failure() && steps.build-linux.conclusion == 'failure' }}
# if: ${{ success() && steps.build-linux.conclusion == 'success' }}
env:
mail: ${{ secrets.SEND_MAIL }}
run: |
echo $mail
echo "CI build code failure ! $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID/$JOB_ID" | mail -s "build code" $mail
- name: upload
env:
passd: ${{ secrets.SEND_MAIL }}
run: |
cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/dc-linux/lib
zip -r -y modules.zip modules
curl -uadmin:${{secrets.ADMIN_PASS}} -T modules.zip ${{secrets.JFROG_PATH}}/dc-linux/modules.zip
cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/dc-linux/arch/riscv
zip -r -y boot.zip boot
curl -uadmin:${{secrets.ADMIN_PASS}} -T boot.zip ${{secrets.JFROG_PATH}}/dc-linux/boot.zip
cd /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/dc-linux/
curl -uadmin:${{secrets.ADMIN_PASS}} -T linux-image-*riscv64.deb ${{secrets.JFROG_PATH}}/dc-linux/linux-image-riscv64.deb
curl -uadmin:${{secrets.ADMIN_PASS}} -T linux-libc-*riscv64.deb ${{secrets.JFROG_PATH}}/dc-linux/linux-libc-riscv64.deb
cd ../
sudo rm -rf /home/gitlab-runner/actions-runner/_work/DC-linux/DC-linux/dc-linux/