|
8 | 8 | build: |
9 | 9 | name: Build |
10 | 10 |
|
11 | | - runs-on: ${{ matrix.runner }} |
| 11 | + runs-on: ubuntu-latest |
12 | 12 |
|
13 | 13 | strategy: |
14 | 14 | fail-fast: false |
15 | 15 | matrix: |
16 | 16 | include: |
17 | | - - arch: x64 |
18 | | - runner: ubuntu-latest |
| 17 | + - image: docker.io/library/dart |
19 | 18 | platform: linux/amd64 |
20 | | - - arch: ia32 |
21 | | - runner: ubuntu-latest |
| 19 | + target: linux-x64 |
| 20 | + - image: docker.io/library/dart |
22 | 21 | platform: linux/amd64 |
23 | | - - arch: arm64 |
24 | | - runner: linux-arm64 |
| 22 | + target: linux-ia32 |
| 23 | + - image: docker.io/library/dart |
25 | 24 | platform: linux/arm64 |
26 | | - - arch: arm |
27 | | - runner: linux-arm64 |
| 25 | + target: linux-arm64 |
| 26 | + - image: docker.io/library/dart |
28 | 27 | platform: linux/arm/v7 |
29 | | - - arch: riscv64 |
30 | | - runner: ubuntu-latest |
| 28 | + target: linux-arm |
| 29 | + - image: docker.io/library/debian:unstable-slim |
31 | 30 | platform: linux/riscv64 |
| 31 | + target: linux-riscv64 |
| 32 | + - image: ghcr.io/dart-musl/dart |
| 33 | + platform: linux/amd64 |
| 34 | + target: linux-x64-musl |
| 35 | + - image: ghcr.io/dart-musl/dart |
| 36 | + platform: linux/amd64 |
| 37 | + target: linux-ia32-musl |
| 38 | + - image: ghcr.io/dart-musl/dart |
| 39 | + platform: linux/arm64 |
| 40 | + target: linux-arm64-musl |
| 41 | + - image: ghcr.io/dart-musl/dart |
| 42 | + platform: linux/arm/v7 |
| 43 | + target: linux-arm-musl |
| 44 | + - image: ghcr.io/dart-musl/dart |
| 45 | + platform: linux/riscv64 |
| 46 | + target: linux-riscv64-musl |
| 47 | + - image: ghcr.io/dart-android/dart |
| 48 | + platform: linux/amd64 |
| 49 | + target: android-x64 |
| 50 | + - image: ghcr.io/dart-android/dart |
| 51 | + platform: linux/amd64 |
| 52 | + target: android-ia32 |
| 53 | + - image: ghcr.io/dart-android/dart |
| 54 | + platform: linux/arm64 |
| 55 | + target: android-arm64 |
| 56 | + - image: ghcr.io/dart-android/dart |
| 57 | + platform: linux/arm64 |
| 58 | + target: android-arm |
| 59 | + - image: ghcr.io/dart-android/dart |
| 60 | + platform: linux/riscv64 |
| 61 | + target: android-riscv64 |
32 | 62 |
|
33 | 63 | steps: |
34 | 64 | - uses: actions/checkout@v4 |
35 | 65 |
|
| 66 | + - uses: ./.github/util/initialize |
| 67 | + with: {github-token: "${{ github.token }}"} |
| 68 | + |
36 | 69 | - name: Set up QEMU |
37 | | - uses: docker/setup-qemu-action@v3 |
38 | | - with: |
39 | | - image: tonistiigi/binfmt:master |
| 70 | + run: docker run --privileged --rm registry.fedoraproject.org/fedora-minimal /bin/sh -c "microdnf install --assumeyes --nodocs --setopt=install_weak_deps=False qemu-user-static systemd-udev && mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc && /usr/lib/systemd/systemd-binfmt --unregister && /usr/lib/systemd/systemd-binfmt" |
40 | 71 |
|
41 | | - - name: Compile Protobuf |
| 72 | + - name: Build |
| 73 | + if: matrix.image != 'ghcr.io/dart-android/dart' && matrix.image != 'docker.io/library/debian:unstable-slim' |
42 | 74 | run: | |
43 | 75 | docker run --rm -i \ |
| 76 | + --platform ${{ matrix.platform }} \ |
44 | 77 | --volume "$PWD:$PWD" \ |
45 | 78 | --workdir "$PWD" \ |
46 | | - docker.io/library/dart <<'EOF' |
| 79 | + ${{ matrix.image }} <<'EOF' |
47 | 80 | set -e |
48 | | - curl -fsSL -H "Authorization: Bearer ${{ github.token }}" "https://github.com/bufbuild/buf/releases/latest/download/buf-$(uname -s)-$(uname -m).tar.gz" | tar -xzC /usr/local --strip-components 1 |
49 | 81 | dart pub get |
50 | | - dart run grinder protobuf |
| 82 | + dart run grinder pkg-standalone-${{ matrix.target }} |
51 | 83 | EOF |
52 | 84 |
|
53 | 85 | - name: Build |
54 | | - if: matrix.arch != 'riscv64' |
| 86 | + if: matrix.image == 'ghcr.io/dart-android/dart' |
55 | 87 | run: | |
56 | 88 | docker run --rm -i \ |
57 | | - --platform ${{ matrix.platform }} \ |
58 | | - --volume "$PWD:$PWD" \ |
59 | | - --workdir "$PWD" \ |
60 | | - docker.io/library/dart:latest <<'EOF' |
| 89 | + --privileged \ |
| 90 | + --platform ${{ matrix.platform }} \ |
| 91 | + --volume "$PWD:$PWD" \ |
| 92 | + --workdir "$PWD" \ |
| 93 | + ${{ matrix.image }} <<'EOF' |
61 | 94 | set -e |
| 95 | + export DART_SDK=/system/${{ endsWith(matrix.target, '64') && 'lib64' || 'lib' }}/dart |
| 96 | + export PATH=$DART_SDK/bin:$PATH |
62 | 97 | dart pub get |
63 | | - dart run grinder pkg-standalone-linux-${{ matrix.arch }} |
| 98 | + dart run grinder pkg-standalone-${{ matrix.target }} |
64 | 99 | EOF |
65 | 100 |
|
66 | 101 | # https://github.com/dart-lang/dart-docker/issues/96#issuecomment-1669860829 |
67 | 102 | # There is no official riscv64 dart container image yet, build on debian:unstable instead. |
68 | 103 | # The setup is adopted from: https://github.com/dart-lang/dart-docker/blob/main/Dockerfile-debian.template |
69 | | - - name: Build riscv64 |
70 | | - if: matrix.arch == 'riscv64' |
| 104 | + - name: Build |
| 105 | + if: matrix.image == 'docker.io/library/debian:unstable-slim' |
71 | 106 | run: | |
72 | 107 | DART_CHANNEL=stable |
73 | 108 | DART_VERSION=$(curl -fsSL https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/latest/VERSION | yq .version) |
74 | | - curl -fsSLO https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/$DART_VERSION/sdk/dartsdk-linux-${{ matrix.arch }}-release.zip |
| 109 | + curl -fsSLO "https://storage.googleapis.com/dart-archive/channels/$DART_CHANNEL/release/$DART_VERSION/sdk/dartsdk-${{ matrix.target }}-release.zip" |
75 | 110 |
|
76 | 111 | docker run --rm -i \ |
77 | | - --platform ${{ matrix.platform }} \ |
78 | | - --volume "$PWD:$PWD" \ |
79 | | - --workdir "$PWD" \ |
80 | | - docker.io/library/debian:unstable-slim <<'EOF' |
| 112 | + --platform ${{ matrix.platform }} \ |
| 113 | + --volume "$PWD:$PWD" \ |
| 114 | + --workdir "$PWD" \ |
| 115 | + ${{ matrix.image }} <<'EOF' |
81 | 116 | set -e |
82 | 117 | apt-get update |
83 | 118 | apt-get install -y --no-install-recommends ca-certificates curl dnsutils git openssh-client unzip |
84 | 119 |
|
85 | 120 | export DART_SDK=/usr/lib/dart |
86 | 121 | export PATH=$DART_SDK/bin:/root/.pub-cache/bin:$PATH |
87 | 122 |
|
88 | | - SDK="dartsdk-linux-${{ matrix.arch }}-release.zip" |
| 123 | + SDK="dartsdk-${{ matrix.target }}-release.zip" |
89 | 124 | unzip "$SDK" && mv dart-sdk "$DART_SDK" && rm "$SDK" |
90 | 125 |
|
91 | 126 | dart pub get |
92 | | - dart run grinder pkg-standalone-linux-${{ matrix.arch }} |
| 127 | + dart run grinder pkg-standalone-${{ matrix.target }} |
93 | 128 | EOF |
94 | 129 |
|
95 | 130 | - name: Upload Artifact |
96 | 131 | uses: actions/upload-artifact@v4 |
97 | 132 | with: |
98 | | - name: build-linux-${{ matrix.arch }} |
| 133 | + name: build-${{ matrix.target }} |
99 | 134 | path: build/*.tar.gz |
100 | 135 | if-no-files-found: error |
101 | 136 | compression-level: 0 |
0 commit comments