-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (51 loc) · 1.74 KB
/
pack.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Pack
on:
push:
branches:
- main
pull_request_target:
branches:
- main
types:
- opened
- synchronize
jobs:
pack:
runs-on: ubuntu-latest
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Checkout
uses: actions/checkout@v3
with:
path: CrimicCosmos
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Get metadata
id: metadata
run: |
NAME=`cat CrimicCosmos/_metadata | jq -r .name`
VERSION=`cat CrimicCosmos/_metadata | jq -r .version`
echo "NAME=${NAME}" >> $GITHUB_OUTPUT
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "FILENAME=${NAME}-${VERSION}.pak" >> $GITHUB_OUTPUT
- name: Pack
run: npx sbpak pack CrimicCosmos ${{ steps.metadata.outputs.FILENAME }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.metadata.outputs.FILENAME }}
path: ${{ steps.metadata.outputs.FILENAME }}
retention-days: 5
- name: Comment
if: github.event_name == 'pull_request_target'
uses: actions/github-script@v6
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `# ビルドに成功しました\n\n- VERSION: ${{ steps.metadata.outputs.VERSION }}\n- FILENAME: ${{ steps.metadata.outputs.FILENAME }}\n\n# pakファイル\n\n/~https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}#artifacts`
})