This script will parse World of Warcraft AddOn metadata files (TOC) and update the Interface version(s) to the most recent version(s) of the game.
This script supports updating the multiple TOC files the game officially supports, such as:
MyAddon.toc(default)MyAddon_Mainline.toc(Retail)MyAddon_Vanilla.toc(Classic Era)MyAddon_Mists.toc(Mists of Pandaria Classic)
Which game "flavor" the script should update for in the unsuffixed TOC file is defined by passing an argument to the script, which can be any of the following:
retail(aliases:mainline)mists(aliases:classic)wrath(aliases:titan)tbc(aliases:anniversary)vanilla(aliases:classic_era)
The script will default to retail unless specified.
The script supports specifying multiple at once, which will create comma-separated interface versions.
One of BigWigs' packager features is the ability for it to automatically create TOC files for flavors based on ## Interface suffixes. This script will also check for those.
The script can optionally support Beta and PTR versions. If their versions are newer than the current game version they will be appended to the interface version. E.g. If retail is 110002 and there's a PTR for 110005 then the TOC file will be updated to: ## Interface: 110002, 110005.
You'll need bash >= 4.0, nc, awk, sed, grep, find, getopt and md5sum installed on your system.
Only GNU versions are officially supported, Busybox alternatives (or others) have not been tested.
Then run the script, some examples:
bash update.sh # use the default flavor
bash update.sh -f classic # set Classic as the default Interface version
bash update.sh -f classic -b -p # set Classic as the default Interface version,
# and add beta and PTR versions
bash update.sh -f retail -f classic # multiple flavors at onceRun the script with --help to see all available options.
You can use this in a GitHub workflow by referencing p3lim/toc-interface-updater.
Options:
flavor- sets the game version for unsuffixed TOC files, see flavor for valid options- Multiple flavors can be specified using a multi-line string:
flavor: | retail classic
- Multiple flavors can be specified using a multi-line string:
beta- set totrueif beta versions should be appendedptr- set totrueif PTR versions should be appendeddepth- change the recursion depth when looking for TOC files
This is an example workflow that will do the following:
- check out the project
- use this script as an action
- create a pull request (if there were changes)
This will occur every day at 12:00.
name: Update TOC Interface version(s)
on:
schedule:
- cron: 0 12 * * *
permissions: # required by the pull request action
contents: write
pull-requests: write
jobs:
run:
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v6
- name: Update TOC Interface version
uses: p3lim/toc-interface-updater@v4
with:
flavor: retail # this is the default
beta: true # this is optional
ptr: true # this is optional
- name: Create pull request
uses: peter-evans/create-pull-request@v8
with:
title: Update Interface version
commit-message: Update Interface version
branch: interface-version
delete-branch: trueImportant
The workflow must be allowed to create Pull Requests for this example to work properly (specifically the last step), this is disabled by default.
In your repository settings, under "Actions" → "General", at the bottom make sure "Allow GitHub Actions to create and approve pull requests" is enabled.