Skip to content

Nightly Build and Publish #6

Nightly Build and Publish

Nightly Build and Publish #6

Workflow file for this run

name: Nightly Build and Publish
on:
schedule:
- cron: '0 5 * * *' # Runs every day at 5AM UTC
workflow_dispatch:
permissions:
packages: write
jobs:
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: dev
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: |
cd Src/GBX.NET
git_hash=$(git rev-parse HEAD)
dotnet build -c Release --no-restore /p:ContinuousIntegrationBuild=true --version-suffix nightly.$(date +'%Y%m%d').${git_hash::7}
- name: Publish nightly ${{ matrix.lib }} nupkg to github.com
run: dotnet nuget push Src/GBX.NET/bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json --skip-duplicate