Skip to content

Commit

Permalink
Update l10n mod in a separate workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AnthonyFuller committed Apr 6, 2024
1 parent 01c0c2c commit 9cac87d
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 84 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/locale-mod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Update Localisation Mod

on:
push:
tags: ["v*"]
workflow_dispatch:

jobs:
update-mod:
name: Update Mod
runs-on: windows-latest

steps:
- name: Checkout Peacock
uses: actions/checkout@v4
with:
token: ${{ secrets.PEACOCKBOT_TOKEN }}
path: "./Peacock"

- name: Checkout Peacock Strings
uses: actions/checkout@v4
with:
token: ${{ secrets.PEACOCKBOT_TOKEN }}
repository: thepeacockproject/peacock-strings
path: "./PeacockStrings"

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "./Peacock/.nvmrc"
cache: "yarn"
cache-dependency-path: "./Peacock/yarn.lock"

- name: Install Packages
run: |
cd Peacock
yarn install --immutable
#- name: Download ResourceLib
# uses: robinraju/[email protected]
# with:
# repository: "OrfeasZ/ZHMTools"
# latest: true
# fileName: "ResourceLib-win-x64.zip"
# out-file-path: "Peacock/resources"

- name: Download RPKG-CLI
id: rpkgcli
uses: robinraju/[email protected]
with:
repository: "glacier-modding/RPKG-Tool"
latest: true
fileName: "rpkg_*-cli.zip"
out-file-path: "Peacock/resources"

- name: Download HMLanguageTools
id: hmlt
uses: robinraju/[email protected]
with:
repository: "AnthonyFuller/TonyTools"
latest: true
fileName: "TonyTools.zip"
out-file-path: "Peacock/resources"

- name: Unzip dependencies
run: |
cd Peacock/resources
7z x ${{ fromJson(steps.rpkgcli.outputs.downloaded_files)[0] }}
7z x ${{ fromJson(steps.hmlt.outputs.downloaded_files)[0] }}
- name: Rebuild Locale Packages
run: |
cd Peacock
yarn rebuild-locale
- name: Copy peacockstrings.locr.json
run: |
copy ./Peacock/resources/peacockstrings.locr.json ./PeacockStrings/content/chunk0/peacockstrings.locr.json
- name: Push updated Peacock LOCR
uses: EndBug/add-and-commit@v9
with:
cwd: "./PeacockStrings"
add: content/chunk0/peacockstrings.locr.json
author_name: PeacockBot
author_email: [email protected]
message: "enhancement: update strings"
85 changes: 1 addition & 84 deletions .github/workflows/locale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ name: Localisation

on:
push:
branches: ["master", "v*"]
tags: ["v*"]
branches: ["master"]
paths: ["resources/locale.json", ".github/workflows/locale.yml"]
workflow_dispatch:

jobs:
rebuild-locale:
name: Rebuild Localisation
if: ${{ !startsWith(github.ref, 'refs/tags/') && endsWith(github.ref, 'master') }}
runs-on: windows-latest

steps:
Expand Down Expand Up @@ -79,84 +77,3 @@ jobs:
author_name: PeacockBot
author_email: [email protected]
message: "[skip ci] Update locale packages"

update-mod:
name: Update Mod
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest

steps:
- name: Checkout Peacock
uses: actions/checkout@v4
with:
token: ${{ secrets.PEACOCKBOT_TOKEN }}
path: "./Peacock"

- name: Checkout Peacock Strings
uses: actions/checkout@v4
with:
token: ${{ secrets.PEACOCKBOT_TOKEN }}
repository: thepeacockproject/peacock-strings
path: "./PeacockStrings"

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: "./Peacock/.nvmrc"
cache: "yarn"
cache-dependency-path: "./Peacock/yarn.lock"

- name: Install Packages
run: |
cd Peacock
yarn install --immutable
#- name: Download ResourceLib
# uses: robinraju/[email protected]
# with:
# repository: "OrfeasZ/ZHMTools"
# latest: true
# fileName: "ResourceLib-win-x64.zip"
# out-file-path: "Peacock/resources"

- name: Download RPKG-CLI
id: rpkgcli
uses: robinraju/[email protected]
with:
repository: "glacier-modding/RPKG-Tool"
latest: true
fileName: "rpkg_*-cli.zip"
out-file-path: "Peacock/resources"

- name: Download HMLanguageTools
id: hmlt
uses: robinraju/[email protected]
with:
repository: "AnthonyFuller/TonyTools"
latest: true
fileName: "TonyTools.zip"
out-file-path: "Peacock/resources"

- name: Unzip dependencies
run: |
cd Peacock/resources
7z x ${{ fromJson(steps.rpkgcli.outputs.downloaded_files)[0] }}
7z x ${{ fromJson(steps.hmlt.outputs.downloaded_files)[0] }}
- name: Rebuild Locale Packages
run: |
cd Peacock
yarn rebuild-locale
- name: Copy peacockstrings.locr.json
run: |
copy ./Peacock/resources/peacockstrings.locr.json ./PeacockStrings/content/chunk0/peacockstrings.locr.json
- name: Push updated Peacock LOCR
uses: EndBug/add-and-commit@v9
with:
cwd: "./PeacockStrings"
add: content/chunk0/peacockstrings.locr.json
author_name: PeacockBot
author_email: [email protected]
message: "enhancement: update strings"

0 comments on commit 9cac87d

Please sign in to comment.