|
22 | 22 | platform: linux/arm/v7
|
23 | 23 | - arch: arm64
|
24 | 24 | platform: linux/arm64
|
25 |
| - # There is no docker image for riscv64 dart-sdk, build kernel snapshot instead. |
26 |
| - # https://github.com/dart-lang/dart-docker/issues/96#issuecomment-1669860829 |
27 | 25 | - arch: riscv64
|
28 |
| - platform: linux/amd64 # linux/riscv64 |
| 26 | + platform: linux/riscv64 |
29 | 27 |
|
30 | 28 | steps:
|
31 | 29 | - uses: actions/checkout@v4
|
|
46 | 44 | EOF
|
47 | 45 |
|
48 | 46 | - name: Build
|
| 47 | + if: matrix.arch != 'riscv64' |
49 | 48 | run: |
|
50 | 49 | docker run --rm -i \
|
51 | 50 | --platform ${{ matrix.platform }} \
|
|
57 | 56 | dart run grinder pkg-standalone-linux-${{ matrix.arch }}
|
58 | 57 | EOF
|
59 | 58 |
|
| 59 | + # https://github.com/dart-lang/dart-docker/issues/96#issuecomment-1669860829 |
| 60 | + # There is no official riscv64 dart container image yet, build on debian:unstable instead. |
| 61 | + # The setup is adopted from: https://github.com/dart-lang/dart-docker/blob/main/Dockerfile-debian.template |
| 62 | + - name: Build riscv64 |
| 63 | + if: matrix.arch == 'riscv64' |
| 64 | + run: | |
| 65 | + DART_CHANNEL=stable |
| 66 | + DART_VERSION=$(curl -fsSL https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/latest/VERSION | yq .version) |
| 67 | + curl -fsSLO https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/$DART_VERSION/sdk/dartsdk-linux-${{ matrix.arch }}-release.zip |
| 68 | +
|
| 69 | + docker run --rm -i \ |
| 70 | + --platform ${{ matrix.platform }} \ |
| 71 | + --volume "$PWD:$PWD" \ |
| 72 | + --workdir "$PWD" \ |
| 73 | + docker.io/library/debian:unstable-slim <<'EOF' |
| 74 | + set -e |
| 75 | + apt-get update |
| 76 | + apt-get install -y --no-install-recommends ca-certificates curl dnsutils git openssh-client unzip |
| 77 | +
|
| 78 | + export DART_SDK=/usr/lib/dart |
| 79 | + export PATH=$DART_SDK/bin:/root/.pub-cache/bin:$PATH |
| 80 | +
|
| 81 | + SDK="dartsdk-linux-${{ matrix.arch }}-release.zip" |
| 82 | + unzip "$SDK" && mv dart-sdk "$DART_SDK" && rm "$SDK" |
| 83 | +
|
| 84 | + dart pub get |
| 85 | + dart run grinder pkg-standalone-linux-${{ matrix.arch }} |
| 86 | + EOF |
| 87 | +
|
60 | 88 | - name: Upload Artifact
|
61 | 89 | uses: actions/upload-artifact@v4
|
62 | 90 | with:
|
|
0 commit comments