Update the content #132
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@main | |
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 | |
id: parse | |
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: Upload logs | |
if: ${{ steps.parse.outputs.logs-upload }} | |
uses: actions/upload-artifact@v3 | |
with: | |
name: 'Logs' | |
path: ${{ steps.parse.outputs.logs-path }} | |
- name: Commit and push new content | |
if: ${{ inputs.push_update }} | |
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 |