Skip to content

Nightly Build from Develop Branch #234

Nightly Build from Develop Branch

Nightly Build from Develop Branch #234

name: Nightly Build from Develop Branch
on:
workflow_dispatch:
schedule:
- cron: '0 23 * * *'
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true
jobs:
# https://stackoverflow.com/a/67527144
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: dev
- name: print latest_commit
run: echo ${{ github.sha }}
- id: should_run
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"
build:
runs-on: ubuntu-latest
name: Deploy pre-release package
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
steps:
- name: Add mask
run: |
echo "::add-mask::${{ secrets.FEEDZ_API_KEY }}"
# https://gitversion.net/docs/reference/requirements
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: dev
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'
- name: Build solution
run: dotnet run --project build/build.csproj --configuration Release -- targets pack
- name: Publish the pre-release package
run: dotnet nuget push ${{ env.GITHUB_WORKSPACE }}/**/*.nupkg --api-key ${{ secrets.FEEDZ_API_KEY }} --source https://f.feedz.io/gowon/pre-release/nuget/index.json --skip-duplicate