Skip to content

Log important items from cleo config #580

Log important items from cleo config

Log important items from cleo config #580

Workflow file for this run

name: Release Preview
on:
workflow_dispatch: # manually
push:
paths-ignore:
- '.github/**'
- 'tests/**'
permissions:
contents: write
jobs:
Release_Preview:
if: (github.ref_type != 'tag' || !endsWith(github.ref, '/preview')) && (github.ref_type != 'branch' || endsWith(github.ref, '/master')) # ignore 'preview' tag, ignore pushes other than to master
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
submodules: "recursive"
- name: Tag with current commit SHA
id: custom_build
run: node.exe .github/workflows/tag-custom-build.js
- name: Detect updates
shell: cmd
run: |
rem Find last tag
for /F %%i in ('git describe --tags --abbrev^=0') do (set tag=%%i)
if "%tag%"=="" (echo ::error::Last tag not found!& exit 1)
if "%tag%"=="preview" (for /F %%i in ('git describe --tags --abbrev^=0 preview^^^^') do set tag=%%i)
rem Check for commits since the tag
for /F %%i in ('git rev-list %tag%..HEAD') do (set commit=%%i)
if "%commit%"=="" (
echo ::notice::No changes since last release found.
) else (
echo Preview build including new features waiting for release. >>preview_changes.md
git show -s --date=format:^"Date: ```%%Y-%%m-%%d``` ^" --format=%%cd>>preview_changes.md
git show -s --format=^"Hash: ```%%h``` ^">>preview_changes.md
echo [**Download**]^(${{github.server_url}}/${{github.repository}}/releases/download/preview/SA.CLEO-v${{steps.custom_build.outputs.version}}-${{steps.custom_build.outputs.sha}}.zip^) >>preview_changes.md
echo;>>preview_changes.md
echo ^<details^>>>preview_changes.md
echo ^<summary^>Changes since %tag%^</summary^>>>preview_changes.md
echo;>>preview_changes.md
git show -s --format=" * %%s" %tag%..HEAD>>preview_changes.md
echo [View commits]^(${{ github.server_url }}/${{ github.repository }}/compare/%tag%...preview^)>>preview_changes.md
echo;>>preview_changes.md
echo ^</details^>>>preview_changes.md
type preview_changes.md
)
- name: Set up MsBuild
if: ${{ hashFiles('preview_changes.md') != '' }}
uses: microsoft/setup-msbuild@6fb02220983dee41ce7ae257b6f4d8f9bf5ed4ce # v2.0.0
- name: Build CLEO Core
if: ${{ hashFiles('preview_changes.md') != '' }}
shell: cmd
run: |
@echo off
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%\third-party\plugin-sdk
msbuild CLEO5.sln /property:Configuration=Release /property:Platform=GTASA /m /fileLogger1 /fileLoggerParameters1:warningsOnly;errorsOnly;logfile=output.log
node .github/workflows/analyze-build-log.js "Core compilation"
- name: Build CLEO Plugins
if: ${{ hashFiles('preview_changes.md') != '' }}
shell: cmd
run: |
@echo off
set PLUGIN_SDK_DIR=%GITHUB_WORKSPACE%\third-party\plugin-sdk
msbuild cleo_plugins/CLEO_Plugins.sln /property:Configuration=Release /property:Platform=x86 /m /fileLogger1 /fileLoggerParameters1:warningsOnly;errorsOnly;logfile=output.log
node .github/workflows/analyze-build-log.js "Plugins compilation"
- name: Gather output files
if: ${{ hashFiles('preview_changes.md') != '' }}
id: prepare_archive
shell: cmd
run: |
@echo Create directories
mkdir .output\Release\cleo
mkdir .output\Release\cleo\.config
mkdir .output\Release\cleo\cleo_plugins
mkdir .output\Release\cleo_readme
@echo Copy files
copy preview_changes.md .output\Release\cleo_readme\CLEO5_Preview.md
copy cleo_plugins\.output\*.cleo .output\Release\cleo\cleo_plugins
copy cleo_plugins\.output\*.ini .output\Release\cleo\cleo_plugins
copy cleo_plugins\Audio\bass\bass.dll .output\Release\bass.dll
@echo Download Sanny Builder Library json
curl -fL https://raw.githubusercontent.com/sannybuilder/library/master/sa/sa.json -o .output\Release\cleo\.config\sa.json
curl -fL https://raw.githubusercontent.com/sannybuilder/library/master/sa/enums.json -o .output\Release\cleo\.config\enums.json
- name: Pack archive
if: ${{ hashFiles('preview_changes.md') != '' }}
uses: thedoctor0/zip-release@b57d897cb5d60cb78b51a507f63fa184cfe35554 # 0.7.6
with:
type: 'zip'
filename: 'SA.CLEO-v${{steps.custom_build.outputs.version}}-${{steps.custom_build.outputs.sha}}.zip'
directory: '.output/Release'
exclusions: '*.pdb *.exp *.lib'
custom: '-mm=Deflate -mfb=258 -mpass=15'
- name: Delete 'preview' release
if: ${{ hashFiles('preview_changes.md') != '' }}
run: gh release delete preview --cleanup-tag --yes
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create 'preview' release
if: ${{ hashFiles('preview_changes.md') != '' }}
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: 'Next version preview'
tag: 'preview'
prerelease: true
bodyFile: 'preview_changes.md'
artifacts: '.output/Release/*.zip'