1// Small script used to calculate the matrix of builds that are going to be
2// done if CI decides to do a release build.
3//
4// This is a separate script primarily to write out all the release
5// targets/platforms once and then duplicate them all with a "min" build.
6
7const ubuntu = 'ubuntu-24.04';
8const windows = 'windows-2025';
9const macos = 'macos-15';
10
11const array = [
12  {
13    // The name of the build which shows up in the name of the artifact for
14    // Wasmtime's github releases.
15    "build": "x86_64-linux",
16    // The GitHub Actions platform that this build runs on
17    "os": ubuntu,
18    // The Rust target that will be used for the build.
19    "target": "x86_64-unknown-linux-gnu",
20    "env": { "DOCKER_IMAGE": "./ci/docker/x86_64-linux/Dockerfile" },
21  },
22  {
23    "build": "aarch64-linux",
24    "os": ubuntu,
25    "target": "aarch64-unknown-linux-gnu",
26    "env": { "DOCKER_IMAGE": "./ci/docker/aarch64-linux/Dockerfile" },
27  },
28  {
29    "build": "s390x-linux",
30    "os": ubuntu,
31    "target": "s390x-unknown-linux-gnu",
32    "env": { "DOCKER_IMAGE": "./ci/docker/s390x-linux/Dockerfile" },
33  },
34  {
35    "build": "riscv64gc-linux",
36    "os": ubuntu,
37    "target": "riscv64gc-unknown-linux-gnu",
38    "env": { "DOCKER_IMAGE": "./ci/docker/riscv64gc-linux/Dockerfile" },
39  },
40  {
41    "build": "x86_64-macos",
42    "os": macos,
43    "target": "x86_64-apple-darwin",
44    // On OSX all we need to do is configure our deployment target as old as
45    // possible. For now 10.9 is the limit.
46    "env": { "MACOSX_DEPLOYMENT_TARGET": "10.9" },
47  },
48  {
49    "build": "aarch64-macos",
50    "os": macos,
51    "target": "aarch64-apple-darwin",
52    "env": { "MACOSX_DEPLOYMENT_TARGET": "10.9" },
53  },
54  {
55    "build": "x86_64-windows",
56    "os": windows,
57    "target": "x86_64-pc-windows-msvc",
58    // On Windows we build against the static CRT to reduce dll dependencies
59    "env": { "RUSTFLAGS": "-Ctarget-feature=+crt-static" },
60  },
61  {
62    "build": "x86_64-mingw",
63    "os": windows,
64    "target": "x86_64-pc-windows-gnu",
65    "env": { "RUSTFLAGS": "-Ctarget-feature=+crt-static" },
66  },
67  {
68    "build": "aarch64-android",
69    "os": ubuntu,
70    "target": "aarch64-linux-android",
71  },
72  {
73    "build": "x86_64-android",
74    "os": ubuntu,
75    "target": "x86_64-linux-android",
76  },
77  {
78    "build": "x86_64-musl",
79    "os": ubuntu,
80    "target": "x86_64-unknown-linux-musl",
81    "env": { "DOCKER_IMAGE": "./ci/docker/x86_64-musl/Dockerfile" },
82  },
83  {
84    "build": "aarch64-musl",
85    "os": ubuntu,
86    "target": "aarch64-unknown-linux-musl",
87    "env": { "DOCKER_IMAGE": "./ci/docker/aarch64-musl/Dockerfile" },
88  },
89  {
90    "build": "aarch64-windows",
91    "os": windows,
92    "target": "aarch64-pc-windows-msvc",
93    "env": { "RUSTFLAGS": "-Ctarget-feature=+crt-static" },
94  },
95  {
96    "build": "i686-linux",
97    "os": ubuntu,
98    "target": "i686-unknown-linux-gnu",
99    "env": { "DOCKER_IMAGE": "./ci/docker/i686-linux/Dockerfile" },
100  },
101  {
102    "build": "armv7-linux",
103    "os": ubuntu,
104    "target": "armv7-unknown-linux-gnueabihf",
105    "env": { "DOCKER_IMAGE": "./ci/docker/armv7-linux/Dockerfile" },
106  },
107  {
108    "build": "i686-windows",
109    "os": windows,
110    "target": "i686-pc-windows-msvc",
111    "env": { "RUSTFLAGS": "-Ctarget-feature=+crt-static" },
112  },
113];
114
115const builds = [];
116for (let build of array) {
117  // Perform a "deep clone" roundtripping through JSON for a copy of the build
118  // that's normal
119  build.rust = 'default';
120  builds.push(JSON.parse(JSON.stringify(build)));
121
122  // Next generate a "min" build and add it to the builds list. Min builds
123  // require Nightly rust due to some nightly build options that are configured.
124  build.build += '-min';
125  build.rust = 'wasmtime-ci-pinned-nightly';
126  builds.push(build);
127}
128
129console.log(JSON.stringify(builds));
130