Update from DMStandard #115
This file contains 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: Update from DMStandard | |
permissions: | |
contents: write | |
pull-requests: write | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
path: "ref" | |
- name: Setup Dotnet | |
uses: actions/setup-dotnet@v4 | |
- name: Build documentation tool | |
run: | | |
cd ref/tools/OpenDreamDocumentationTool | |
git submodule update --init | |
cd OpenDream | |
git checkout master && git pull | |
git submodule update --init --recursive && cd .. | |
dotnet build -o $GITHUB_WORKSPACE/oddt-bin OpenDreamDocumentationTool | |
- name: Get DMStandard | |
uses: actions/checkout@v3 | |
with: | |
repository: "OpenDreamProject/OpenDream" | |
path: opendream | |
- name: Run Documentation Tool | |
run: | | |
dotnet oddt-bin/OpenDreamDocumentationTool.dll --documentation=ref --standard=opendream/DMCompiler/DMStandard | |
- name: Install dependencies | |
uses: bahmutov/npm-install@v1 | |
with: | |
working-directory: ref | |
- name: Auto-Format | |
run: | | |
cd ref | |
npm run format | |
- name: Commit | |
continue-on-error: true | |
run: | | |
cd ref | |
git submodule update --init | |
git config --local user.email "action@github.com" | |
git config --local user.name "Autodoc" | |
git checkout -b autodoc-update | |
git add content | |
git commit -m "Automatic DMStandard update" -a || true | |
git push -f -u origin autodoc-update | |
- name: Create Pull Request | |
if: ${{ success() }} | |
continue-on-error: true | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
cd ref | |
gh pr create --title "Automatic Reference Update" --body "This pull request updates the reference based on the [DMStandard](https://github.com/OpenDreamProject/OpenDream/tree/master/DMCompiler/DMStandard), as generated by the [Documentation Tool](https://github.com/OpenDreamProject/od-dm-reference/tree/main/tools/OpenDreamDocumentationTool)." |