blob: 1608262d98182533efdd976c3d2bcf2f84da1739 (
plain)
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
|
name: "Build SD images"
on:
workflow_call:
inputs:
git_ref:
required: true
type: string
jobs:
build-rpi:
runs-on: ubuntu-latest
env:
HCLOUD_TOKEN: "${{ secrets.TEST_AUTOMATION_HCLOUD_API_TOKEN }}"
UID: "${{ github.run_id }}-rpi"
VERSION: "${{ inputs.git_ref }}"
defaults:
run:
shell: bash
outputs:
artifact_name: ${{ steps.pack-rpi.outputs.artifact_name }}
steps:
- uses: 3bit/setup-hcloud@v1
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: Build RPI SD Image
id: build-rpi
run: |
set -e
IMG="NextCloudPi_RPi_$( date "+%m-%d-%y" ).img"
wget -q https://github.com/multiarch/qemu-user-static/releases/latest/download/qemu-aarch64-static -O ./qemu-aarch64-static
./build/build-SD-rpi.sh
echo "::set-output name=image::${IMG}"
- name: Pack RPI Image
id: pack-rpi
run: |
IMG="${{ steps.build-rpi.outputs.image }}"
TAR="$( basename "$IMG" .img ).tar.gz"
. ./build/buildlib.sh
pack_image "tmp/$IMG" "output/$TAR"
echo "::set-output name=artifact_name::${TAR}"
- name: upload RPI image to artifact store
uses: actions/upload-artifact@v3
with:
name: ${{ github.run_id }}-rpi-image
path: output/${{ steps.pack-rpi.outputs.artifact_name }}
if-no-files-found: error
build-armbian:
runs-on: ubuntu-latest
env:
VERSION: "${{ inputs.git_ref }}"
defaults:
run:
shell: bash
outputs:
artifact_name: ${{ steps.pack-armbian.outputs.artifact_name }}
strategy:
matrix:
board:
- odroidxu4 OdroidHC2
- rockpro64 RockPro64
- rock64 Rock64
- bananapi Bananapi
- odroidhc4 OdroidHC4
- odroidc4 OdroidC4
- odroidc2 OdroidC2
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: "Build Armbian"
id: build-armbian
run: |
set -x
export LIB_TAG=master
board_params=(${{ matrix.board}})
IMG="NextCloudPi_${board_params[1]}_$( date "+%m-%d-%y" ).img"
./build/build-SD-armbian.sh "${board_params[@]}"
echo "::set-output name=image::${IMG}"
- name: "Pack image"
id: pack-armbian
run: |
IMG="${{ steps.build-armbian.outputs.image }}"
TAR="$( basename "$IMG" .img ).tar.gz"
artifacts=("armbian/output/images/Armbian"*.img)
mv "${artifacts[0]}" "tmp/$IMG"
. ./build/buildlib.sh
pack_image "tmp/$IMG" "output/$TAR"
echo "::set-output name=artifact_name::${TAR}"
- name: upload Armbian image to artifact store
uses: actions/upload-artifact@v3
with:
name: ${{ github.run_id }}-armbian-image
path: output/${{ steps.build-pack-armbian.outputs.artifact_name }}
if-no-files-found: error
|