-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (86 loc) · 2.94 KB
/
update.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
name: Update the content
on:
workflow_dispatch:
inputs:
push_update:
description: 'Should we push update to github?'
required: false
default: false
type: boolean
PBE:
description: 'PBE?'
required: false
default: false
type: boolean
workflow_call:
inputs:
push_update:
required: false
default: true
type: boolean
PBE:
required: false
default: false
type: boolean
secrets:
LOL_USERNAME:
required: true
LOL_PASSWORD:
required: true
LOL_USERNAME_PBE:
required: false
LOL_PASSWORD_PBE:
required: false
LOL_REGION:
required: true
jobs:
update:
runs-on: windows-latest
steps:
- name: Checkout watchdog repository
uses: actions/checkout@v4
with:
path: 'watchdog'
- name: Checkout content repository
uses: actions/checkout@v4
with:
repository: 'lol-tracker/content'
ssh-key: ${{ secrets.CONTENT_SSH_PRIVATE_KEY }}
ref: ${{ github.ref_name }}
path: 'content'
- name: Setup the League Client
id: league-client
uses: lol-tracker/setup-league-client
with:
username: ${{ !inputs.PBE && secrets.LOL_USERNAME || secrets.LOL_USERNAME_PBE }}
password: ${{ !inputs.PBE && secrets.LOL_PASSWORD || secrets.LOL_PASSWORD_PBE }}
region: ${{ !inputs.PBE && secrets.LOL_REGION || 'pbe' }}
patchline: ${{ !inputs.PBE && 'live' || 'pbe' }}
config: ${{ inputs.PBE && 'PBE' || '' }}
install-pengu: true
- name: Parse the content
working-directory: content
shell: pwsh
run: '& ../watchdog/updater/update.ps1'
env:
RCS_PASSWORD: ${{ steps.league-client.outputs.rcs-password }}
RCS_PORT: ${{ steps.league-client.outputs.rcs-port }}
RCS_DIR: ${{ steps.league-client.outputs.rcs-directory }}
LCU_PASSWORD: ${{ steps.league-client.outputs.lcu-password }}
LCU_PORT: ${{ steps.league-client.outputs.lcu-port }}
LCU_DIR: ${{ steps.league-client.outputs.lcu-directory }}
LCU_PATCHLINE: ${{ !inputs.PBE && 'live' || 'pbe' }}
PENGU_DIR: ${{ steps.league-client.outputs.pengu-directory }}
- name: Commit and push new content
if: ${{ github.event.inputs.push_update == 'true' }}
working-directory: content
shell: pwsh
run: |
git config --global user.email "github-action-${{github.actor}}@users.noreply.github.com"
git config --global user.name "lol-tracker-bot"
git pull
git add .
$patchline = '${{ !inputs.PBE && 'live' || 'pbe' }}'
$ver = (Get-Content "lol/$patchline/version.txt" | ConvertFrom-Json)
git commit -m "[$($patchline.ToUpper())] Client: $($ver.client) / Game: $($ver.game)"
git push