Skip to content

okay

okay #92

Workflow file for this run

name: WikiWire
on:
push:
branches: [main]
paths:
- 'modules/**'
- 'modules/*'
- 'templates/**'
- 'templates/*'
jobs:
wikiwire:
runs-on: ubuntu-latest
name: Sync files to production MediaWiki
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Darklua
run: |
wget -q https://github.com/seaofvoices/darklua/releases/download/v0.18.0/darklua-linux-x86_64.zip
unzip -q darklua-linux-x86_64.zip
chmod +x darklua
- name: Setup Lua 5.1
uses: leafo/gh-actions-lua@v12
with:
luaVersion: "5.1.5"
- name: Regenerate Lua outputs for changed Luau modules
shell: bash
env:
BEFORE: ${{ github.event.before }}
AFTER: ${{ github.sha }}
run: |
set -euo pipefail
if [[ -z "${BEFORE:-}" || "${BEFORE}" =~ ^0+$ ]]; then
changed_files="$(git show --name-only --pretty=format: "${AFTER}")"
else
changed_files="$(git diff --name-only "${BEFORE}" "${AFTER}")"
fi
while IFS= read -r path; do
[[ -n "$path" ]] || continue
[[ "$path" == modules/* ]] || continue
[[ "$path" =~ \.module\.luau$ ]] || continue
out_path="${path%.module.luau}.module.lua"
mkdir -p "$(dirname "$out_path")"
./darklua process --config .darklua.json5 "$path" "$out_path"
node scripts/polyfill.js "$out_path"
node scripts/compatibility.js "$out_path"
cp "$out_path" "$out_path.raw"
# lua "$out_path.raw"
done <<< "$changed_files"
- name: Fail if outputs were not committed
run: git diff --exit-code
- uses: obbywiki/wikiwire@8923b248626912ae0fb58b3acc54e0a555e39347
env:
GITHUB_TOKEN: ${{ secrets.WIKIWIRE_GITHUB_TOKEN }}
with:
username: WikiWireBot@WikiWire
password: ${{ secrets.WIKIWIRE_PASSWORD }}
dark_lua_compat: "false"