forked from KallistiOS/KallistiOS
-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (76 loc) · 2.46 KB
/
autobuild.yml
File metadata and controls
92 lines (76 loc) · 2.46 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
name: Linux build
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
dockerhub_user: pcercuei
jobs:
matrix:
if: github.repository == 'KallistiOS/KallistiOS'
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setup-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- name: Setup matrix
id: setup-matrix
run: |
echo "matrix=$($GITHUB_WORKSPACE/.github/list-profiles.sh)" >> $GITHUB_OUTPUT
build:
needs: matrix
if: github.repository == 'KallistiOS/KallistiOS'
strategy:
fail-fast: false
matrix:
toolchain: ${{ fromJSON(needs.matrix.outputs.matrix) }}
runs-on: ubuntu-latest
env:
platform: ${{ fromJSON(matrix.toolchain).platform }}
profile: ${{ fromJSON(matrix.toolchain).profile }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
paths:
- .github/workflows/autobuild.yml
- .github/workflows/build-kos.sh
- .github/workflows/list-profiles.sh
- utils/kos-chain/**
- name: build-toolchain
if: steps.filter.outputs.paths == 'true'
run: >
sudo docker build
-t $dockerhub_user/$platform-toolchain:$profile
--build-arg platform=$platform
--build-arg profile=$profile
-f $GITHUB_WORKSPACE/utils/kos-chain/docker/Dockerfile
$GITHUB_WORKSPACE
- name: publish
if: steps.filter.outputs.paths == 'true' && github.event_name == 'push'
run: |
echo "${{ secrets.DOCKER_HUB_KEY }}" | sudo docker login -u $dockerhub_user --password-stdin
sudo docker push $dockerhub_user/$platform-toolchain:$profile
sudo docker logout
- name: build-kos-check
run: |
if [ -d $GITHUB_WORKSPACE/kernel/arch/$platform ] ; then
echo "BUILD_KOS=true" >> $GITHUB_ENV
else
echo "BUILD_KOS=false" >> $GITHUB_ENV
fi
- name: build-kos
if: env.BUILD_KOS == 'true'
run: >
# Login to Docker before building to get the usage limits of an authenticated user
echo "${{ secrets.DOCKER_HUB_KEY }}" | sudo docker login -u $dockerhub_user --password-stdin
sudo docker run --rm --name kallistios
-v $GITHUB_WORKSPACE:/workspace -w /workspace
$dockerhub_user/$platform-toolchain:$profile
.github/build-kos.sh $platform
sudo docker logout