Skip to content

Autowiki

Autowiki #304

Workflow file for this run

name: Autowiki
on:
schedule:
- cron: "5 4 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
autowiki:
runs-on: ubuntu-latest
steps:
- name: "Check for AUTOWIKI_USERNAME"
id: secrets_set
env:
ENABLER_SECRET: ${{ secrets.AUTOWIKI_USERNAME }}
run: |
unset SECRET_EXISTS
if [ -n "$ENABLER_SECRET" ]; then SECRET_EXISTS=true ; fi
echo "SECRETS_ENABLED=$SECRET_EXISTS" >> $GITHUB_OUTPUT
- name: Checkout
if: steps.secrets_set.outputs.SECRETS_ENABLED
uses: actions/checkout@v3
- name: Setup BYOND cache
id: cache-byond
if: steps.secrets_set.outputs.SECRETS_ENABLED
uses: actions/cache@v3
with:
path: ~/BYOND
key: ${{ runner.os }}-byond-cache-${{ secrets.CACHE_PURGE_KEY }}-${{ hashFiles('dependencies.sh') }}
- name: Install BYOND
if: steps.cache-byond.outputs.cache-hit != 'true' && steps.secrets_set.outputs.SECRETS_ENABLED
run: bash tools/ci/install_byond.sh
- name: Install runtime dependencies
if: steps.secrets_set.outputs.SECRETS_ENABLED
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-configure=false libssl-dev:i386
bash tools/ci/install_rust_g.sh
- name: Cache dependencies
if: steps.secrets_set.outputs.SECRETS_ENABLED
uses: actions/cache@v3
with:
path: ~/.byond/bin
key: ${{ runner.os }}-deps-cache-${{ secrets.CACHE_PURGE_KEY }}-${{ hashFiles('dependencies.sh') }}
- name: Install build dependencies
if: steps.cache-deps.outputs.cache-hit != 'true' && steps.secrets_set.outputs.SECRETS_ENABLED
run: |
sudo apt install -o APT::Immediate-Configure=false libgcc-s1:i386 g++-multilib zlib1g-dev:i386
rustup target add i686-unknown-linux-gnu
- name: Build auxmos
if: steps.cache-deps.outputs.cache-hit != 'true' && steps.secrets_set.outputs.SECRETS_ENABLED
run: bash tools/ci/build_auxmos.sh
- name: Build rust-g
if: steps.cache-deps.outputs.cache-hit != 'true' && steps.secrets_set.outputs.SECRETS_ENABLED
run: bash tools/ci/build_rust_g.sh
- name: Compile and generate Autowiki files
if: steps.secrets_set.outputs.SECRETS_ENABLED
run: |
bash tools/ci/install_byond.sh
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci autowiki
- name: Run Autowiki
if: steps.secrets_set.outputs.SECRETS_ENABLED
env:
USERNAME: ${{ secrets.AUTOWIKI_USERNAME }}
PASSWORD: ${{ secrets.AUTOWIKI_PASSWORD }}
run: |
cd tools/autowiki
npm install
cd ../..
node tools/autowiki/autowiki.js data/autowiki_edits.txt data/autowiki_files/