41
41
- name : Setup Node.js
42
42
uses : actions/setup-node@v3
43
43
with :
44
- node-version : 18
44
+ node-version : ' lts/* '
45
45
cache : ' yarn'
46
46
47
47
- run : yarn install --mode=update-lockfile
@@ -64,20 +64,61 @@ jobs:
64
64
git commit -m "chore: add docs for $(npm pkg get version --json | jq -r)"
65
65
git push --force
66
66
67
- publish :
67
+ build :
68
+ name : Build
68
69
runs-on : ubuntu-latest
69
70
needs : release
70
71
if : ${{ needs.release.outputs.releases_created }}
72
+ strategy :
73
+ matrix :
74
+ profile : [debug, release, weval]
71
75
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
74
115
with :
75
116
submodules : true
76
117
77
118
- name : Setup Node.js
78
119
uses : actions/setup-node@v3
79
120
with :
80
- node-version : 18
121
+ node-version : ' lts/* '
81
122
cache : ' yarn'
82
123
registry-url : ' https://registry.npmjs.org'
83
124
@@ -87,21 +128,28 @@ jobs:
87
128
with :
88
129
path : " /home/runner/.cargo/bin/wasm-tools"
89
130
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
97
131
98
132
- run : yarn install --immutable
99
133
100
- - run : yarn build
134
+ - name : Download Engine Release
135
+ uses : actions/download-artifact@v3
136
+ with :
137
+ name : fastly-release
101
138
102
- - run : yarn build:debug
139
+ - name : Download Engine Debug
140
+ uses : actions/download-artifact@v3
141
+ with :
142
+ name : fastly-debug
103
143
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
105
153
106
154
- run : npm publish
107
155
env :
0 commit comments