Skip to content

Commit 7f618bd

Browse files
committed
git: Update CircuitPython action inputs and improve entrypoint logic
Refactor input parameters in action.yml and README to use 'port' instead of 'cpy_platform'. Enhance entrypoint.sh to streamline repository fetching and building processes for CircuitPython ports. Signed-off-by: Chiho Sin <[email protected]>
1 parent 5028125 commit 7f618bd

File tree

8 files changed

+293
-184
lines changed

8 files changed

+293
-184
lines changed

.github/workflows/docker_build.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ on:
1616
required: false
1717
type: boolean
1818
default: false
19-
cpy_platform:
20-
description: CircuitPython platform to target
19+
port:
20+
description: CircuitPython port to target
2121
required: true
2222
type: string
2323
outputs:
@@ -42,7 +42,7 @@ jobs:
4242
digest: ${{ steps.docker_platform.outputs.digest }}
4343
runs-on: ${{ inputs.runs-on }}
4444
steps:
45-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v5
4646

4747
- uses: docker/setup-qemu-action@v3
4848

@@ -67,17 +67,21 @@ jobs:
6767
with:
6868
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6969
tags: |
70-
GHA-main-${{ inputs.cpy_platform }}-${{ steps.sanitize_platform.outputs.cleaned_platform }}
70+
GHA-main-${{ inputs.port }}-${{ steps.sanitize_platform.outputs.cleaned_platform }}
7171
flavor: latest=false
7272

73+
- name: Set up Docker Buildx
74+
uses: docker/setup-buildx-action@v3
75+
7376
- name: Docker build and push
7477
uses: docker/build-push-action@v6
7578
id: docker_platform
7679
with:
7780
context: .
81+
cache-from: type=registry,ref=${{ steps.meta.outputs.tags }}-buildcache
82+
cache-to: type=registry,ref=${{ steps.meta.outputs.tags }}-buildcache,mode=max
7883
push: ${{ inputs.push }}
7984
tags: ${{ steps.meta.outputs.tags }}
8085
labels: ${{ steps.meta.outputs.labels }}
8186
platforms: ${{ inputs.platform }}
82-
build-args: |
83-
BUILD_PLATFORM=${{ inputs.cpy_platform }}
87+
target: ${{ inputs.port }}

.github/workflows/docker_manifest.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Build container manifest
22
on:
33
workflow_call:
44
inputs:
5-
cpy_platform:
6-
description: CircuitPython platform to target
5+
port:
6+
description: CircuitPython port to build
77
required: true
88
type: string
99

@@ -21,17 +21,16 @@ jobs:
2121
docker-amd64:
2222
uses: ./.github/workflows/docker_build.yml
2323
with:
24-
cpy_platform: ${{ inputs.cpy_platform }}
24+
port: ${{ inputs.port }}
2525
platform: linux/amd64
2626
runs-on: ubuntu-24.04
2727
push: true
2828
secrets: inherit
2929

3030
docker-arm64:
31-
if: inputs.cpy_platform != 'litex'
3231
uses: ./.github/workflows/docker_build.yml
3332
with:
34-
cpy_platform: ${{ inputs.cpy_platform }}
33+
port: ${{ inputs.port }}
3534
platform: linux/arm64
3635
runs-on: ubuntu-24.04-arm
3736
push: true
@@ -43,7 +42,7 @@ jobs:
4342
- docker-arm64
4443
runs-on: ubuntu-24.04
4544
steps:
46-
- uses: actions/checkout@v4
45+
- uses: actions/checkout@v5
4746

4847
- name: Docker Login GHCR
4948
uses: docker/login-action@v3
@@ -58,7 +57,7 @@ jobs:
5857
with:
5958
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
6059
tags: |
61-
main-${{ inputs.cpy_platform }}
60+
main-${{ inputs.port }}
6261
flavor: latest=false
6362

6463
- name: Create Docker manifest
@@ -70,4 +69,4 @@ jobs:
7069
push: true
7170
sources: |
7271
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.docker-amd64.outputs.digest }}
73-
${{ inputs.cpy_platform != 'litex' && env.REGISTRY }}/${{ inputs.cpy_platform != 'litex' && env.IMAGE_NAME }}@${{ inputs.cpy_platform != 'litex' && needs.docker-arm64.outputs.digest }}
72+
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@${{ needs.docker-arm64.outputs.digest }}

.github/workflows/on_pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
cpy_platform:
16+
port:
1717
# - analog
1818
# - atmel-samd
1919
# - broadcom
@@ -29,7 +29,7 @@ jobs:
2929
# - zephyr-cp
3030
uses: ./.github/workflows/docker_build.yml
3131
with:
32-
cpy_platform: ${{ matrix.cpy_platform }}
32+
port: ${{ matrix.port }}
3333
platform: linux/amd64
3434
runs-on: ubuntu-24.04
3535
push: false

.github/workflows/on_push.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
cpy_platform:
23+
port:
2424
# - analog
2525
# - atmel-samd
2626
# - broadcom
@@ -36,5 +36,5 @@ jobs:
3636
# - zephyr-cp
3737
uses: ./.github/workflows/docker_manifest.yml
3838
with:
39-
cpy_platform: ${{ matrix.cpy_platform }}
39+
port: ${{ matrix.port }}
4040
secrets: inherit

0 commit comments

Comments
 (0)