Skip to content

Commit 3616db2

Browse files
updated gh action workflow to build docker image and publish to dockerhub, need to test
1 parent a3fd689 commit 3616db2

File tree

3 files changed

+32
-13
lines changed

3 files changed

+32
-13
lines changed

.github/workflows/build-u-boot.yaml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ on:
99
jobs:
1010

1111
build-image:
12-
1312
runs-on: ubuntu-latest
14-
1513
steps:
1614
- uses: actions/checkout@v4
1715

16+
- name: Set build date
17+
run: echo "DATE=$(date +'%Y%m%d')" >> "$GITHUB_ENV"
18+
1819
- name: Prepare u-boot tree
1920
run: |
2021
bash build.sh setup_tree
@@ -23,21 +24,28 @@ jobs:
2324
- uses: docker/setup-qemu-action@v3
2425
- uses: docker/setup-buildx-action@v3
2526

26-
- name: Build and push
27-
uses: docker/build-push-action@v6
27+
- uses: docker/login-action@v3
2828
with:
29-
platforms: linux/amd64,linux/arm64
30-
push: false
31-
tags: onion/u-boot-builder
29+
username: ${{ secrets.DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.DOCKERHUB_TOKEN }}
3231

33-
- name: Build multi-arch image and push
32+
- name: Build multiarch image and push
3433
uses: docker/build-push-action@v6
3534
with:
3635
context: .
3736
file: ./Dockerfile
3837
platforms: linux/amd64,linux/arm64
39-
push: false
40-
tags: onion/u-boot-builder:latest
38+
push: true
39+
tags: |
40+
onion/u-boot-builder:latest
41+
onion/u-boot-builder:${{ env.DATE }}
42+
# onion/u-boot-builder:${{ env.DATE }}-${{ github.sha::7 }}
4143
#tags: ${{ env.REGISTRY }}/u-boot-builder:${{ github.sha }}
42-
#cache-from: type=registry,ref=${{ env.REGISTRY }}/u-boot-builder:buildcache
43-
#cache-to: type=registry,ref=${{ env.REGISTRY }}/u-boot-builder:buildcache,mode=max
44+
# cache-from: type=registry,ref=${{ env.REGISTRY }}/u-boot-builder:buildcache
45+
# cache-to: type=registry,ref=${{ env.REGISTRY }}/u-boot-builder:buildcache,mode=max
46+
cache-from: type=registry,ref=onion/u-boot-builder:buildcache
47+
cache-to: type=registry,ref=onion/u-boot-builder:buildcache,mode=max
48+
49+
- name: Export image tag
50+
id: meta
51+
run: echo "tag=onion/u-boot-builder:${{ env.DATE }}

build.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
[ -z "$REPO" ] && exit 1
66
[ -z "$TARGET_DEVICE" ] && exit 1
77
[ -z "$TARGET_ARCH" ] && exit 1
8-
[ -z "$TTARGET_CROSS_COMPILEARGET_ARCH" ] && exit 1
8+
[ -z "$TARGET_CROSS_COMPILE" ] && exit 1
9+
[ -z "$RELEASE" ] && exit 1
910

1011
REPO_NAME="u-boot"
1112

@@ -42,6 +43,13 @@ setup_tree () {
4243
echo "Tree setup complete, ready to make Docker container or build directly"
4344
}
4445

46+
# build_uboot() {
47+
# cd /u-boot
48+
# make ${TARGET_DEVICE}_defconfig
49+
# make ARCH=${TARGET_ARCH} CROSS_COMPILE=${TARGET_CROSS_COMPILE}
50+
# cp u-boot-with-spl.bin /out/u-boot-with-spl-${RELEASE}-$(date +'%Y%m%d').bin
51+
# }
52+
4553
commands="
4654
setup_tree
4755
"

profile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
REPO="https://github.com/OnionIoT/u-boot"
44
COMMIT="5f87035d7d82fdc72ba872308bf9f4998f2e57f5"
5+
RELEASE="v2025.04"
56

67
TARGET_DEVICE="onion-omega2p"
78
TARGET_ARCH="mips"
89
TARGET_CROSS_COMPILE="mipsel-linux-gnu-"
10+
11+

0 commit comments

Comments
 (0)