Skip to content

Release v0.4.0

Release v0.4.0 #48

Workflow file for this run

name: .NET Build
on:
push:
branches:
- master
pull_request:
branches:
- master
- dev
workflow_dispatch:
inputs:
releasePage:
description: 'Release to GitHub Pages? (Y/N)'
required: false
default: 'N'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install Excubo.WebCompiler
run: dotnet tool install Excubo.WebCompiler --global
- name: Install dependencies
run: dotnet restore
- name: 'Compile Static Files: /wwwroot/css'
run: webcompiler -r Randominator/wwwroot/css -c Randominator/webcompiler.json
- name: 'Compile Static Files: /UI'
run: webcompiler -r Randominator/UI -c Randominator/webcompiler.json
- name: Publish solution
run: dotnet publish Randominator --no-restore --nologo -c Release -o bin/publish
- name: Run tests
run: dotnet test --no-restore --nologo --verbosity normal
- name: Version static files
uses: jacobtomlinson/gha-find-replace@v2
with:
find: '(?i)%%VERSION%%'
replace: ${{ github.run_id }}
regex: true
include: 'bin/publish/wwwroot/**.html'
- name: Create 404.html
run: 'cp -p -n bin/publish/wwwroot/index.html bin/publish/wwwroot/404.html'
- name: Generate robots.txt
run: 'dotnet run --project Randominator.SitemapRenderer'
- name: Release to GitHub Pages
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event.inputs.releasePage == 'Y'
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: bin/publish/wwwroot
cname: randominator.tehgm.net
force_orphan: true
- name: Ping Google
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event.inputs.releasePage == 'Y'
run: 'curl https://www.google.com/ping?sitemap=https://randominator.tehgm.net/sitemap.xml'
- name: Ping Bing
if: (github.event_name == 'push' && github.ref == 'refs/heads/master') || github.event.inputs.releasePage == 'Y'
run: 'curl https://www.bing.com/ping?sitemap=https://randominator.tehgm.net/sitemap.xml'