Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fantomas": {
"version": "7.0.5",
"commands": [
"fantomas"
],
"rollForward": false
},
"paket": {
"version": "10.3.1",
"commands": [
"paket"
],
"rollForward": false
}
}
}
76 changes: 45 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
force:
description: 'Set to "true" to mark this run as forced when manually triggered'
required: false
default: 'false'
default: "false"

jobs:
build:
Expand All @@ -22,36 +22,50 @@ jobs:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: true
- name: Setup Quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: refresh publications and commit changes
if: ${{ github.event_name == 'workflow_dispatch' || github.event.inputs.force == 'true' }}
env:
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
run: |
dotnet fsi getcomputo-pub.fsx
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Stage the generated files (ignore errors if files missing)
git add site/published.yml site/pipeline.yml site/mock-papers.yml || true
# Only commit if there are staged changes
if git diff --staged --quiet; then
echo "No publication changes to commit"
else
git commit -m "Update publications from getcomputo-pub.fsx [skip ci]"
# push to the branch that triggered the workflow
git push origin HEAD:${{ github.ref_name }}
fi
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: true
- name: Setup Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: "10.0.x"

- name: Restore build tooling
run: |
dotnet tool restore
dotnet tool run paket restore

- name: Run tests
run: dotnet run --project src/Build.fsproj -- -t Test

- name: refresh publications and commit changes
if: ${{ github.event_name == 'workflow_dispatch' || github.event.inputs.force == 'true' }}
env:
API_GITHUB_TOKEN: ${{ secrets.API_GITHUB_TOKEN }}
Comment on lines +46 to +49
run: |
dotnet run --project src/Build.fsproj -- -t UpdatePublications
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Stage the generated files (ignore errors if files missing)
git add site/published.{yml,xml} site/pipeline.yml site/mock-papers.yml || true
# Only commit if there are staged changes
if git diff --staged --quiet; then
echo "No publication changes to commit"
else
git commit -m "Refresh publication metadata [skip ci]"
# push to the branch that triggered the workflow
git push origin HEAD:${{ github.ref_name }}
fi

- name: Build site
uses: quarto-dev/quarto-actions/render@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
- name: Build site
run: dotnet run --project src/Build.fsproj -- -t RenderSite
- name: Upload artifact
uses: actions/upload-pages-artifact@v3

# Deployment job
deploy:
Expand All @@ -70,4 +84,4 @@ jobs:
id: deployment
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading