-
Notifications
You must be signed in to change notification settings - Fork 230
132 lines (117 loc) · 4.35 KB
/
pull_request_dispatch.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
132
name: PR Checks Dispatch
on:
repository_dispatch:
types: [start-pr-checks]
permissions:
issues: write
pull-requests: write
contents: write
jobs:
run-plogon:
name: Build Plugins
runs-on: ubuntu-latest
steps:
- uses: navikt/github-app-token-generator@v1
id: get-token
with:
private-key: ${{ secrets.GH_APP_PK }}
app-id: ${{ secrets.GH_APP_ID }}
- uses: LouisBrunner/checks-action@v1.2.0
id: register_check
with:
token: ${{ steps.get-token.outputs.token }}
name: Build PR
sha: ${{ github.event.client_payload.ref }}
status: in_progress
details_url: "https://github.com/goatcorp/DalamudPluginsD17/actions/runs/${{ github.run_id }}"
- name: Setup Difftastic
run: |
wget https://github.com/Wilfred/difftastic/releases/latest/download/difft-x86_64-unknown-linux-gnu.tar.gz
tar -xzf difft-x86_64-unknown-linux-gnu.tar.gz
sudo mv difft /usr/local/bin/difft
sudo chmod +x /usr/local/bin/difft
difft --version
- name: Setup terminal-to-html
run: |
wget https://github.com/buildkite/terminal-to-html/releases/download/v3.14.0/terminal-to-html-3.14.0-linux-amd64.gz
gunzip terminal-to-html-3.14.0-linux-amd64.gz
sudo chmod +x terminal-to-html-3.14.0-linux-amd64
sudo mv terminal-to-html-3.14.0-linux-amd64 /usr/local/bin/terminal-to-html
terminal-to-html --version
- name: Checkout manifests from incoming PR
uses: actions/checkout@v3
with:
repository: goatcorp/DalamudPluginsD17
path: manifests
ref: ${{ github.event.client_payload.ref }}
- name: Checkout manifests from master
uses: actions/checkout@v3
with:
repository: goatcorp/DalamudPluginsD17
path: manifests-master
ref: main
- name: Checkout Plogon
uses: actions/checkout@v3
with:
repository: goatcorp/Plogon
#ref: V1.0.6
path: Plogon
- name: Checkout Dist
uses: actions/checkout@v3
with:
repository: goatcorp/PluginDistD17
path: output
ref: main
- name: Create required folders
run: |
mkdir artifacts
mkdir static
mkdir work
- name: Cache docker image
uses: actions/cache@v3
env:
cache-name: ${{ secrets.EXTENDED_IMAGE_LINK }}
with:
path: ~/.plogon_cache
key: cache-${{ env.cache-name }}
- name: Run Plogon
id: plogon_run
working-directory: Plogon/Plogon
env:
GITHUB_TOKEN: ${{ secrets.GH_BOT_PAT }}
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
XLWEB_KEY: ${{ secrets.XLWEB_KEY }}
EXTENDED_IMAGE_LINK: ${{ secrets.EXTENDED_IMAGE_LINK }}
PLOGON_SECRETS_PK: ${{ secrets.PLOGON_SECRETS_PK }}
PLOGON_SECRETS_PK_PASSWORD: ${{ secrets.PLOGON_SECRETS_PK_PASSWORD }}
GITHUB_REPOSITORY: ${{ github.repository }}
PR_ACTOR: ${{ github.event.client_payload.actor }}
GITHUB_PR_NUM: ${{ github.event.client_payload.prnum }}
GITHUB_RUN_ID: ${{ github.run_id }}
run: |
dotnet run -- \
--manifest-folder="${{ github.workspace }}/manifests" \
--output-folder="${{ github.workspace }}/output" \
--work-folder="${{ github.workspace }}/work" \
--static-folder="${{ github.workspace }}/Plogon/Plogon/static" \
--artifact-folder="${{ github.workspace }}/artifacts" \
--build-overrides-file="${{ github.workspace }}/manifests-master/overrides.toml" \
--ci --mode=PullRequest
cat $GITHUB_STEP_SUMMARY
echo ::set-output name=summary::$(cat $GITHUB_STEP_SUMMARY)
echo ::set-output name=summary_json::$(awk '{printf "%s\\n", $0}' $GITHUB_STEP_SUMMARY)
echo ${{ steps.plogon_run.outputs.summary }}
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: plugin-artifact
path: artifacts
- uses: LouisBrunner/checks-action@v1.2.0
if: always()
with:
token: ${{ steps.get-token.outputs.token }}
check_id: ${{ steps.register_check.outputs.check_id }}
conclusion: ${{ job.status }}
details_url: "https://github.com/goatcorp/DalamudPluginsD17/actions/runs/${{ github.run_id }}"
output: |
{"summary":"${{ steps.plogon_run.outputs.summary_json }}"}