Skip to content

WolvenKit-Nightly

WolvenKit-Nightly #823

Workflow file for this run

name: WolvenKit-Nightly
on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
env:
FINALOUT: ./publish
NAME: WolvenKit
MREPO: ${{github.repository}}
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v3
with:
ref: main
- id: should_run
name: check latest commit is less than a day
run: |
myvar=$(git rev-list --after="24 hours" HEAD)
if (test ! -z "$myvar"); then HAS_COMMITS='true'; else HAS_COMMITS='false'; fi;
echo "$HAS_COMMITS"
echo "should_run="$HAS_COMMITS"" >> $GITHUB_OUTPUT
nightly-wkit-win:
needs: check_date
if: ${{ needs.check_date.outputs.should_run == 'true' }}
runs-on: windows-2022
steps:
##########################################
# SETUP
- name: checkout
uses: actions/checkout@v3
with:
ref: main
- name: Get commit
run: |
$commit = git log -1 --format=%H
echo "SHA=$commit" >> $env:GITHUB_ENV
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.x
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1
- name: Get Date
run: |
$date = Get-Date -Format "yyyy-MM-dd"
echo "ISODATE=$date" >> $env:GITHUB_ENV
##########################################
# APP
- name: Get version
uses: naminodarie/get-net-sdk-project-versions-action@v1.1.2
id: get_version
with:
proj-path: ./WolvenKit/WolvenKit.csproj
- run: echo "VERSION_APP=${{steps.get_version.outputs.assembly-version}}-nightly.${{env.ISODATE}}" >> $env:GITHUB_ENV
- run: echo "PORTABLE=${{env.NAME}}-${{env.VERSION_APP}}.zip" >> $env:GITHUB_ENV
# Publish app
- name: Restore packages
run: dotnet restore --packages .nuget --runtime win-x64
- name: Publish app with msbuild
run: msbuild WolvenKit/WolvenKit.csproj -p:Configuration=Release -p:Platform=x64 -m -p:Runtimeidentifier=win-x64 -verbosity:minimal /t:Publish -p:PublishDir=.\..\publish\app -p:VersionSuffix="nightly.${{env.ISODATE}}" -p:InformationalVersion="${{env.VERSION_APP}}"
- name: Publish cli with msbuild
run: msbuild WolvenKit.CLI/WolvenKit.CLI.csproj -p:Configuration=Release -p:Platform=x64 -m -p:Runtimeidentifier=win-x64 -verbosity:minimal /t:Publish -p:PublishDir=.\..\publish\app -p:VersionSuffix="nightly.${{env.ISODATE}}" -p:InformationalVersion="${{env.VERSION_APP}}"
- name: Compress release
run: Compress-Archive -Path ./publish/app/* -DestinationPath ${{env.FINALOUT}}/${{env.PORTABLE}}
##########################################
# INSTALLER
- name: create installer
run: ISCC /O"${{env.FINALOUT}}" /dMyAppBaseDir="..\publish\app\" /dMyAppName="WolvenKit (TW3) Nightly" /dMyAppId="WolvenKit-7-Nightly" .\Installers\installer.iss
##########################################
# RELEASE
# tag main commit
- name: Create Tag
id: tag_version
uses: rfuzzo/github-tag-action@7b0316b3fb8aa236fdc20bee0614ea6ef99f4bf1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: false
custom_tag: ${{ env.VERSION_APP }}
tag_prefix: ""
- name: Release dispatch
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION_APP }}
generate_release_notes: false
files: |
${{ env.FINALOUT }}/*.zip
${{ env.FINALOUT }}/*.exe
repository: WolvenKit/WolvenKit-7-nightly
token: ${{ secrets.RELEASE_TOKEN }}
body: "This is a beta release so you may encounter bugs. Please report them.\n${{ steps.tag_version.outputs.changelog }}"