the encore #49
This file contains hidden or 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: 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 https://github.com/seaofvoices/darklua/releases/download/v0.18.0/darklua-linux-x86_64.zip | |
| unzip darklua-linux-x86_64.zip | |
| chmod +x darklua | |
| - name: Regenerate Lua outputs for changed Luau modules | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| changed_files="$(git diff --name-only "${{ github.event.before }}" "${{ github.sha }}")" | |
| while IFS= read -r path; do | |
| [[ "$path" == modules/**/*.module.luau ]] || continue | |
| out_path="${path%.module.luau}.module.lua" | |
| mkdir -p "$(dirname "$out_path")" | |
| ./darklua process --config .darklua.json5 "$path" "$out_path" | |
| done <<< "$changed_files" | |
| - name: Fail if outputs were not committed | |
| run: git diff --exit-code | |
| - uses: obbywiki/wikiwire@1afa3c89890ba386bf2e34247d4ad0c5ba20fcb8 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.WIKIWIRE_GITHUB_TOKEN }} | |
| with: | |
| username: WikiWireBot@WikiWire | |
| password: ${{ secrets.WIKIWIRE_PASSWORD }} | |
| dark_lua_compat: "false" |