Skip to content

Wyam2 nightly build #761

Wyam2 nightly build

Wyam2 nightly build #761

Workflow file for this run

name: Wyam2 nightly build
on:
schedule:
- cron: '30 0 * * *'
env:
DOTNET_NOLOGO: true
# Stop wasting time caching packages
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending usage data to Microsoft
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Project name to pack and publish
PROJECT_NAME: Wyam2
jobs:
check_date:
runs-on: ubuntu-latest
name: Check last day commits that touched src or theme folders
outputs:
create_nightlies: ${{ steps.should_run.outputs.create_nightlies }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: check commits less than a day that had changes in src or theme folders
id: should_run
continue-on-error: true
run: test $(git log --pretty="format:" --since="2 days ago" --name-only | grep -c -e '^src' -e '^themes' ) -eq 0 && echo "::set-output name=create_nightlies::false" || echo "::set-output name=create_nightlies::true"
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
2.1.x
2.2.x
3.1.x
5.0.x
6.0.x
- run: dotnet --list-sdks
- run: dotnet --list-runtimes
- name: Build and test
run: ./build.ps1 -Target Run-Tests
shell: pwsh
nightly:
needs: [check_date, build]
if: ${{ needs.check_date.outputs.create_nightlies != 'false' }}
runs-on: windows-latest
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup dotnet 2.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
2.1.x
2.2.x
3.1.x
5.0.x
6.0.x
- run: dotnet --list-sdks
- run: dotnet --list-runtimes
- name: Nightly pack
run: ./build.ps1 -Target Nightly
shell: pwsh
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: nupkg
path: ./build/choco/*.nupkg
housekeeping:
needs: [nightly]
if: success()
runs-on: ubuntu-latest
steps:
- name: Remove oldest nightly - batch1
uses: smartsquaregmbh/[email protected]
with:
keep: 2
names: |
Wyam2
Wyam2.All
Cake.Wyam2
Wyam2.Configuration
Wyam2.Core
Wyam2.Common
Wyam2.AmazonWebServices
Wyam2.CodeAnalysis
Wyam2.Feeds
Wyam2.GitHub
Wyam2.Hosting
Wyam2.Minification
Wyam2.Highlight
Wyam2.Images
Wyam2.Markdown
Wyam2.Html
Wyam2.Less
Wyam2.Json
Wyam2.SearchIndex
Wyam2.Tables
- name: Remove oldest nightly - batch2
uses: smartsquaregmbh/[email protected]
with:
keep: 2
names: |
Wyam2.Blog
Wyam2.Blog.BlogTemplate
Wyam2.Blog.SolidState
Wyam2.Blog.CleanBlog
Wyam2.Blog.Phantom
Wyam2.Blog.Stellar
Wyam2.Blog.Trophy
Wyam2.Docs.Samson
Wyam2.Docs
Wyam2.Web
Wyam2.Razor
Wyam2.YouTube
Wyam2.Xmp
Wyam2.Yaml
Wyam2.Tool
Wyam2.Sass
Wyam2.Testing
Wyam2.Testing.Javascript