-
Notifications
You must be signed in to change notification settings - Fork 156
131 lines (120 loc) · 4.32 KB
/
build-misc.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
on:
push:
branches:
- main
- development
- rc-v*
- release/*
- hotfix/*
- fast-track/*
tags: ["*"]
pull_request:
types: [ready_for_review, opened, reopened, auto_merge_enabled]
issue_comment: []
name: Build-misc
jobs:
build_9c:
name: build_lib9c
runs-on: ubuntu-20.04
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/checkout@master
with:
submodules: recursive
- run: hooks/pre-commit
- uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
msg: >
@${{ github.actor }} Your pull request does not pass lint checks.
You probably haven't configured hooks in your local Git repository.
Please configure Git hooks in your local repository using the below
command:
git config core.hooksPath hooks
if: failure() && github.event_name == 'pull_request'
- run: sudo apt install libimage-exiftool-perl
- id: clv
run: .github/bin/check-libplanet-version.sh
- uses: unsplash/comment-on-pr@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: failure() && github.event_name == 'pull_request'
with:
msg: >
@${{ github.actor }} The versions of bundled Libplanet assemblies and
Libplanet submodule vendored by Lib9c apparently do not match:
- Libplanet submdoule: ${{ steps.clv.outputs.submodule_version }}
${{ join(fromJSON(steps.clv.outputs.unmatches), fromJSON('"\n"')) }}
Leave a comment in this pull_request with the following command to
let the bot upgrade bundled Libplanet assemblies:
> /update-libplanet-dlls
# The action for command /update-libplanet-dlls is implemented below.
update-libplanet-dlls:
runs-on: ubuntu-20.04
name: Update bundled Libplanet assemblies
if: >-
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.sender.type == 'User' &&
contains(github.event.comment.body, '/update-libplanet-dlls')
steps:
- uses: dkershner6/reaction-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commentId: ${{ github.event.comment.id }}
reaction: eyes
- id: pr-metadata
run: |
set -evxou pipefail
curl -o "/tmp/pr-$PR_ID.json" "$PR_API_URL"
jq -r '"::set-output name=repo::" + .head.repo.full_name' \
"/tmp/pr-$PR_ID.json"
jq -r '"::set-output name=ref::" + .head.ref' \
"/tmp/pr-$PR_ID.json"
env:
PR_ID: ${{ github.event.issue.id }}
PR_API_URL: ${{ github.event.issue.pull_request.url }}
- uses: actions/checkout@v3
with:
repository: ${{ steps.pr-metadata.outputs.repo }}
ref: ${{ steps.pr-metadata.outputs.ref }}
submodules: recursive
lfs: true
- run: . scripts/update-libplanet-dlls.ps1
shell: pwsh
- run: sudo apt install libimage-exiftool-perl
- run: |
set -evxou pipefail
version="$(.github/bin/check-libplanet-version.sh | head -n1)"
git config user.name "$(curl $GIT_AUTHOR_API_URL | jq -r .name)"
git config user.email "$GIT_AUTHOR_EMAIL"
git commit \
-m "Upgrade Libplanet assemblies to $version" \
nekoyume/Assets/Packages/Libplanet*.{dll,xml}
git push
env:
GIT_AUTHOR_API_URL: ${{ github.event.sender.url }}
GIT_AUTHOR_EMAIL: >-
${{ github.event.sender.id }}+${{
github.event.sender.login }}@users.noreply.github.com
- if: failure()
uses: dkershner6/reaction-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commentId: ${{ github.event.comment.id }}
reaction: confused
- if: success()
uses: dkershner6/reaction-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
commentId: ${{ github.event.comment.id }}
reaction: rocket
build_installer:
runs-on: windows-latest
name: build installer
if: github.event_name == 'push' || github.event_name == 'pull_request'
steps:
- uses: actions/[email protected]
- run: dotnet publish tools/Updater/Updater/Updater.csproj -r win-x64 --self-contained
- run: ISCC tools/installer/installer.iss