-
Notifications
You must be signed in to change notification settings - Fork 51
/
action.yml
58 lines (57 loc) · 1.86 KB
/
action.yml
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
name: "OpenWrt SDK"
description: "Build OpenWrt packages via the SDK"
author: aparcar
runs:
using: 'composite'
steps:
- run: |
echo "artifacts_dir=${ARTIFACTS_DIR:-$GITHUB_WORKSPACE}" >> "$GITHUB_OUTPUT"
echo "feed_dir=${FEED_DIR:-$GITHUB_WORKSPACE}" >> "$GITHUB_OUTPUT"
shell: bash
id: inputs
- run: sudo chown -R 1000:1000 ${{ steps.inputs.outputs.artifacts_dir }} ${{ steps.inputs.outputs.feed_dir }}
shell: bash
-
name: Set up Docker QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build Docker container image
uses: docker/build-push-action@v6
env:
DOCKER_BUILD_SUMMARY: false
with:
push: false
tags: sdk
context: ${{ github.action_path }}
build-args: |
CONTAINER
ARCH
cache-to: type=gha,mode=max,scope=${{ env.CONTAINER }}-${{ env.ARCH }}
cache-from: type=gha,scope=${{ env.CONTAINER }}-${{ env.ARCH }}
load: true
- run: |
docker run --rm \
--env BUILD_LOG \
--env EXTRA_FEEDS \
--env FEEDNAME \
--env IGNORE_ERRORS \
--env KEY_BUILD \
--env NO_DEFAULT_FEEDS \
--env NO_REFRESH_CHECK \
--env NO_SHFMT_CHECK \
--env PACKAGES \
--env INDEX \
--env V \
-v ${{ steps.inputs.outputs.artifacts_dir }}:/artifacts \
-v ${{ steps.inputs.outputs.feed_dir }}:/feed \
sdk
shell: bash
- run: sudo chown -R --reference=${{ steps.inputs.outputs.artifacts_dir }}/.. ${{ steps.inputs.outputs.artifacts_dir }}
shell: bash
if: always()
- run: sudo chown -R --reference=${{ steps.inputs.outputs.feed_dir }}/.. ${{ steps.inputs.outputs.feed_dir }}
shell: bash
if: always()