Skip to content

Commit 7d1ffc9

Browse files
committed
Update build.yml
1 parent 1585094 commit 7d1ffc9

File tree

1 file changed

+52
-13
lines changed

1 file changed

+52
-13
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,49 @@ on:
1616
default: main
1717

1818
jobs:
19+
archive:
20+
runs-on: ubuntu-latest
21+
22+
container:
23+
image: docker.io/library/debian
24+
25+
strategy:
26+
fail-fast: false
27+
matrix:
28+
include:
29+
- host-arch: x64
30+
31+
steps:
32+
- name: Install build tools
33+
run: |
34+
apt-get update
35+
apt-get install --no-install-recommends -y ca-certificates curl git python3
36+
37+
- name: Fetch Dart SDK
38+
run: |
39+
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
40+
export DEPOT_TOOLS_UPDATE=0 PATH=$PWD/depot_tools:$PATH
41+
42+
mkdir dart-sdk
43+
cd dart-sdk
44+
gclient config --name sdk https://dart.googlesource.com/sdk.git@${{ inputs.ref }}
45+
gclient sync --no-history
46+
47+
- name: Archive
48+
run: |
49+
tar -czf dart-${{ inputs.ref }}-${{ matrix.host-arch }}.tar.gz dart-sdk
50+
51+
- name: Upload Artifact
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: dart-${{ inputs.ref }}-${{ matrix.host-arch }}
55+
path: dart-${{ inputs.ref }}-${{ matrix.host-arch }}.tar.gz
56+
if-no-files-found: error
57+
compression-level: 0
58+
1959
build:
60+
needs: [archive]
61+
2062
runs-on: ubuntu-latest
2163

2264
container:
@@ -38,10 +80,19 @@ jobs:
3880
target-arch: riscv64
3981

4082
steps:
83+
- name: Download Artifact
84+
uses: actions/download-artifact@v4
85+
with:
86+
name: dart-${{ inputs.ref }}-${{ matrix.host-arch }}
87+
88+
- name: Unarchive
89+
run: |
90+
tar -xzf dart-${{ inputs.ref }}-${{ matrix.host-arch }}.tar.gz
91+
4192
- name: Install build tools
4293
run: |
4394
apt-get update
44-
apt-get install --no-install-recommends -y ca-certificates curl git python3 xz-utils
95+
apt-get install --no-install-recommends -y ca-certificates curl git python3
4596
4697
- name: Setup multiarch
4798
run: |
@@ -58,18 +109,6 @@ jobs:
58109
;;
59110
esac
60111
61-
- name: Fetch Dart SDK
62-
id: fetch
63-
run: |
64-
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
65-
export DEPOT_TOOLS_UPDATE=0 PATH=$PWD/depot_tools:$PATH
66-
67-
mkdir dart-sdk
68-
cd dart-sdk
69-
gclient config --name sdk https://dart.googlesource.com/sdk.git@${{ inputs.ref }}
70-
echo "target_os = ['android']" | tee -a .gclient
71-
gclient sync --no-history
72-
73112
- name: Build
74113
run: |
75114
cd dart-sdk/sdk

0 commit comments

Comments
 (0)