forked from ayufan-rock64/linux-kernel
-
Notifications
You must be signed in to change notification settings - Fork 7
107 lines (103 loc) · 3.41 KB
/
Copy pathmain.yml
File metadata and controls
107 lines (103 loc) · 3.41 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
name: Build Docker Image
on:
push:
tags:
- '*'
branches:
- '*'
workflow_dispatch:
jobs:
build-docker-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: checkout
uses: actions/checkout@v6
- uses: dorny/paths-filter@v4
id: filter
with:
filters: |
src:
- '.github/**'
- name: Log into registry ghcr.io
if: (github.event_name != 'pull_request' && steps.filter.outputs.src == 'true') || startsWith(github.event.ref, 'refs/tags/v')
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
if: (github.event_name != 'pull_request' && steps.filter.outputs.src == 'true') || startsWith(github.event.ref, 'refs/tags/v')
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/scpcom/linux-sbc-build
- name: Build and push Docker image
if: (github.event_name != 'pull_request' && steps.filter.outputs.src == 'true') || startsWith(github.event.ref, 'refs/tags/v')
id: build-and-push
uses: docker/build-push-action@v7
with:
context: .
file: ./.github/scripts/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: pause
if: (github.event_name != 'pull_request' && steps.filter.outputs.src == 'true') || startsWith(github.event.ref, 'refs/tags/v')
run: sleep 120
build-image:
strategy:
matrix:
boards: [sun20i, spacemit]
archs: [riscv64]
include:
- boards: n1
archs: arm64
- boards: [bpi, nas5xx]
archs: armhf
runs-on: ubuntu-latest
needs: build-docker-image
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Get Board Configs
uses: actions/checkout@v6
- name: Build Images
uses: scpcom/docker-run-action@v4
with:
image: ghcr.io/scpcom/linux-sbc-build:${{ github.ref_name }}
options: --privileged -v ${{ github.workspace }}/images/:/output -v ${{ github.workspace }}/configs/:/configs/
run: |
ARCH=${{ matrix.archs }} BOARD=${{ matrix.boards }} GIT_REF=${{ github.ref_name }} ./make_image.sh
chmod 777 /output/
- name: Pack
run: |
cd images/
ls -lah
echo "PACKAGE=${{ github.workspace }}/images/*" >> $GITHUB_ENV
- name: Upload package
uses: actions/upload-artifact@v7
with:
name: image-files-${{ matrix.boards }}-${{ matrix.archs }}
path: |
${{env.PACKAGE}}
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [build-image]
permissions: write-all
steps:
- name: download firmware
uses: actions/download-artifact@v8
- name: list images
run: |
ls -lah
ls -lah image-files-*/
- name: publish artifacts
uses: softprops/action-gh-release@v3
with:
append_body: true
files: |
image-files-*/*