generate-xref-maps #170
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: generate-xref-maps | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5 * * SUN' | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install DocFX | |
run: choco install docfx -y | |
- name: Restore Packages | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Checkout GitHub Pages branch | |
uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: UnityXRefMap/out | |
- name: Clean existing GitHub Pages files | |
run: | | |
cd UnityXRefMap/out | |
git rm -r . | |
- name: Run | |
run: | | |
cd UnityXRefMap | |
dotnet run --configuration Release --no-build | |
- name: Upload XRef Maps | |
uses: actions/upload-artifact@v4 | |
with: | |
name: xrefmaps | |
path: UnityXRefMap/out | |
- name: Push to GitHub Pages | |
run: | | |
$hash = (git log -n 1 --pretty="%h").Trim() | |
$name = (git log -n 1 --pretty="%an").Trim() | |
$email = (git log -n 1 --pretty="%ae").Trim() | |
cd UnityXRefMap/out | |
echo "Committing as $name <$email>" | |
git config user.name $name | |
git config user.email $email | |
git add . | |
git commit --message "Scheduled XRef Map Update" | |
git push |