forked from RPi-Distro/pi-gen
-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (67 loc) · 2.08 KB
/
kuiper2_0-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
name: Kuiper2.0
on:
push:
branches:
- staging/kuiper2.0
pull_request:
branches:
- staging/kuiper2.0
jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
arch: [32, 64]
build_type: [basic, full]
include:
- arch: 32
build_type: basic
os: ubuntu-latest
- arch: 64
build_type: basic
os: ubuntu-latest
- arch: 32
build_type: full
os: [self-hosted, kuiper32_full]
- arch: 64
build_type: full
os: ubuntu-latest
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set env variabiles
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
BRANCH=$GITHUB_BASE_REF
else
BRANCH=$GITHUB_REF_NAME
fi
branch_name=$(echo $BRANCH | tr 'a-z' 'A-Z' | sed 's/[^[:alnum:]]/_/g')
type=$( echo ${{ matrix.build_type }} | tr 'a-z' 'A-Z')
echo ARTIFACT_NAME=kuiper_"${{ matrix.build_type }}"_"${{ matrix.arch }}" >> $GITHUB_ENV
echo BRANCH_NAME="$branch_name"_"$type"_"${{ matrix.arch }}" >> $GITHUB_ENV
- name: Build image
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
sudo apt-get update
sudo apt-get install -y qemu-user-static
fi
ci/modify_config.sh ./config "${{ vars[format('{0}', env.BRANCH_NAME )] }}"
sudo bash build-docker.sh
ls kuiper-volume/*.zip >/dev/null 2>&1 && exit 0 || exit 2
- name: Upload image
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ github.workspace }}/kuiper-volume
Trigger_workflow:
needs: Build
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v3
- name: Trigger docker build
run: gh workflow run docker-image-build.yml --ref staging/kuiper2.0
env:
GH_TOKEN: ${{ github.token }}