-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (41 loc) · 1.34 KB
/
archive.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: archive
on:
workflow_call:
inputs:
ref:
required: false
type: string
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# 実装を見ると空でデフォルト値を参照できることがわかる
# https://github.com/actions/checkout/blob/2541b1294d2704b0964813337f33b291d3f8596b/src/input-helper.ts#L59-L76
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v3
- name: Calculate hash of gcf-minecraft-starter
run: |
echo -n "TARGET_ARCHIVE_NAME=" >> $GITHUB_ENV
./.github/calculate-archive-name.sh >> $GITHUB_ENV
- name: Lookup build cache
uses: actions/cache@v3
with:
path: ${{ env.TARGET_ARCHIVE_NAME }}
key: v1-gcf-archive-${{ env.TARGET_ARCHIVE_NAME }}
restore-keys: |
v1-gcf-archive-${{ env.TARGET_ARCHIVE_NAME }}
- name: Build and archive
run: |
if [ ! -e $TARGET_ARCHIVE_NAME ]; then
yarn --cwd gcf-minecraft-starter
make archive
mv gcf-minecraft-starter/dist/gcf-minecraft-starter.zip $TARGET_ARCHIVE_NAME
fi
- uses: actions/upload-artifact@v3
with:
name: gcf-archive
path: ${{ env.TARGET_ARCHIVE_NAME }}