Skip to content

Commit 8520b85

Browse files
committed
ci: add release generator
1 parent c0e7c0b commit 8520b85

File tree

4 files changed

+15298
-9518
lines changed

4 files changed

+15298
-9518
lines changed

.github/workflows/deploy.yml

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,53 @@ jobs:
188188
with:
189189
name: ${{ runner.os }}-${{ github.job }}-${{ needs.install.outputs.version }}
190190
path: functions/dist
191+
192+
release:
193+
runs-on: ubuntu-latest
194+
needs: [build-ssr, build-csr, build-functions, install]
195+
steps:
196+
- uses: actions/checkout@v2
197+
- uses: actions/setup-node@v2-beta
198+
with:
199+
node-version: '10'
200+
- name: Cache node_modules
201+
id: cache-node_modules
202+
uses: actions/[email protected]
203+
with:
204+
path: |
205+
~/.npm
206+
node_modules
207+
**/node_modules
208+
${{ steps.npm-cache.outputs.dir }}
209+
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
210+
restore-keys: ${{ runner.os }}-node-
211+
- name: Cache functions node_modules
212+
id: cache-functions-node_modules
213+
uses: actions/[email protected]
214+
with:
215+
path: functions/node_modules
216+
key: ${{ runner.os }}-node-functions-${{ hashFiles('functions/package-lock.json') }}
217+
restore-keys: ${{ runner.os }}-node-functions-
218+
219+
# Download all artifacts
220+
- uses: actions/download-artifact@v2
221+
with:
222+
name: ${{ runner.os }}-build-ssr-${{ needs.build-ssr.outputs.version }}
223+
path: public-ssr
224+
- uses: actions/download-artifact@v2
225+
with:
226+
name: ${{ runner.os }}-build-csr-${{ needs.build-csr.outputs.version }}
227+
path: public-csr
228+
- uses: actions/download-artifact@v2
229+
with:
230+
name: ${{ runner.os }}-build-functions-${{ needs.install.outputs.version }}
231+
path: functions/dist
232+
233+
- run: npm run release
191234

192235
deploy-ssr:
193236
runs-on: ubuntu-latest
194-
needs: [build-ssr, install]
237+
needs: [release, build-ssr, install]
195238
env:
196239
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
197240
GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
@@ -230,7 +273,7 @@ jobs:
230273

231274
deploy-csr:
232275
runs-on: ubuntu-latest
233-
needs: [build-csr, install]
276+
needs: [release, build-csr, install]
234277
env:
235278
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
236279
GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
@@ -269,7 +312,7 @@ jobs:
269312

270313
deploy-functions:
271314
runs-on: ubuntu-latest
272-
needs: [build-functions, install]
315+
needs: [release, build-functions, install]
273316
env:
274317
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
275318
GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}

.releaserc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"plugins": [
3+
"@semantic-release/commit-analyzer",
4+
"@semantic-release/release-notes-generator",
5+
["@semantic-release/github", {
6+
"assets": [
7+
{"path": "public/**", "label": "UI Distribution"},
8+
{"path": "functions/dist/**", "label": "Functions Distribution"}
9+
]
10+
}]
11+
]
12+
}

0 commit comments

Comments
 (0)