Skip to content

Nightly Release

Nightly Release #1183

name: Nightly Release
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
tests:
uses: ./.github/workflows/run_integration_tests.yml
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@master
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: check latest commit is less than a day ago
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
build_and_publish_nightly:
needs: [check_date, tests]
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: windows-2022
name: build_and_publish_nightly
steps:
- uses: actions/checkout@master
- name: Set up dotnet core
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
2.1.x
6.0.x
8.0.x
- name: Add msbuild to PATH
uses: microsoft/[email protected]
- name: Write nightly version to projects
run: |
$newVer = .\tools\generate-nightly-version.ps1; .\tools\set-version.ps1 $newVer
- name: Restore packages
run: dotnet restore tools/UglyToad.PdfPig.Package/UglyToad.PdfPig.Package.csproj
- name: Build package
run: dotnet pack -c Release -o package tools/UglyToad.PdfPig.Package/UglyToad.PdfPig.Package.csproj -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
- name: Publish Nuget to GitHub registry
run: dotnet nuget push **/*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}