4141 - name : Setup Node.js
4242 uses : actions/setup-node@v3
4343 with :
44- node-version : 18
44+ node-version : ' lts/* '
4545 cache : ' yarn'
4646
4747 - run : yarn install --mode=update-lockfile
@@ -64,20 +64,61 @@ jobs:
6464 git commit -m "chore: add docs for $(npm pkg get version --json | jq -r)"
6565 git push --force
6666
67- publish :
67+ build :
68+ name : Build
6869 runs-on : ubuntu-latest
6970 needs : release
7071 if : ${{ needs.release.outputs.releases_created }}
72+ strategy :
73+ matrix :
74+ profile : [debug, release, weval]
7175 steps :
72- - name : Checkout
73- uses : actions/checkout@v3
76+ - uses : actions/checkout@v3
77+ with :
78+ submodules : true
79+ - name : Install Rust 1.77.1
80+ run : |
81+ rustup toolchain install 1.77.1
82+ rustup target add wasm32-wasi --toolchain 1.77.1
83+ - name : Restore wasm-tools from cache
84+ uses : actions/cache@v3
85+ id : wasm-tools
86+ with :
87+ path : " /home/runner/.cargo/bin/wasm-tools"
88+ key : crate-cache-wasm-tools-${{ env.wasm-tools_version }}
89+ - name : Build
90+ if : ${{ matrix.profile == 'release' }}
91+ run : npm run build
92+ - name : Build
93+ if : ${{ matrix.profile == 'debug' }}
94+ run : npm run build:debug
95+ - name : Build
96+ if : ${{ matrix.profile == 'weval' }}
97+ run : npm run build:weval
98+ - uses : actions/upload-artifact@v3
99+ with :
100+ if-no-files-found : error
101+ name : fastly-${{ matrix.profile }}
102+ path : fastly${{ matrix.profile == 'debug' && '.debug.wasm' || (matrix.profile == 'weval' && '-weval.wasm' || '.wasm') }}
103+ - uses : actions/upload-artifact@v3
104+ if : ${{ matrix.profile == 'weval' }}
105+ with :
106+ name : fastly-${{ matrix.profile }}-ic-cache
107+ path : fastly-ics.wevalcache
108+
109+ publish :
110+ runs-on : ubuntu-latest
111+ needs : [release, build]
112+ if : ${{ needs.release.outputs.releases_created }}
113+ steps :
114+ - uses : actions/checkout@v3
74115 with :
75116 submodules : true
76117
77118 - name : Setup Node.js
78119 uses : actions/setup-node@v3
79120 with :
80- node-version : 18
121+ node-version : ' lts/* '
81122 cache : ' yarn'
82123 registry-url : ' https://registry.npmjs.org'
83124
@@ -87,21 +128,28 @@ jobs:
87128 with :
88129 path : " /home/runner/.cargo/bin/wasm-tools"
89130 key : crate-cache-wasm-tools-${{ env.wasm-tools_version }}
90-
91- - name : " Check wasm-tools has been restored"
92- if : steps.wasm-tools.outputs.cache-hit != 'true'
93- run : |
94- echo "wasm-tools was not restored from the cache"
95- echo "bailing out from the build early"
96- exit 1
97131
98132 - run : yarn install --immutable
99133
100- - run : yarn build
134+ - name : Download Engine Release
135+ uses : actions/download-artifact@v3
136+ with :
137+ name : fastly-release
101138
102- - run : yarn build:debug
139+ - name : Download Engine Debug
140+ uses : actions/download-artifact@v3
141+ with :
142+ name : fastly-debug
103143
104- - run : yarn build:weval
144+ - name : Download Engine Weval
145+ uses : actions/download-artifact@v3
146+ with :
147+ name : fastly-weval
148+
149+ - name : Download Engine Weval Cache
150+ uses : actions/download-artifact@v3
151+ with :
152+ name : fastly-weval-ic-cache
105153
106154 - run : npm publish
107155 env :
0 commit comments