Update nightly.yaml #5
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Nightly build | |
| on: | |
| push: | |
| branches: [ main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: windows-2025 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup NSIS | |
| run: winget install NSIS.NSIS --accept-source-agreements --accept-package-agreements | |
| - name: Install Visual Studio Build Tools | |
| shell: pwsh | |
| run: | | |
| $installerUrl = "https://aka.ms/vs/17/release/vs_buildtools.exe" | |
| $installerPath = Join-Path $env:TEMP "vs_BuildTools.exe" | |
| Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath | |
| Start-Process -FilePath $installerPath -ArgumentList "--quiet", "--wait", "--norestart", "--nocache", ` | |
| "--installPath", "C:\BuildTools", ` | |
| "--add", "Microsoft.VisualStudio.Workload.VCTools", ` | |
| "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", ` | |
| "--add", "Microsoft.VisualStudio.Component.Windows10SDK.19041", ` | |
| "--version", "17.12.35707.178" ` | |
| -Wait -NoNewWindow | |
| - name: Build with build.bat | |
| shell: cmd | |
| run: call build.bat | |
| - name: Compile the NSIS installer | |
| shell: cmd | |
| run: '"C:\Program Files (x86)\NSIS\makensis.exe" .\installer\installer.nsi' | |
| - name: Get commit hash | |
| id: get_commit | |
| shell: bash | |
| run: | | |
| echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Generate release notes | |
| id: release_notes | |
| shell: bash | |
| run: | | |
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| if [ -z "$LAST_TAG" ]; then | |
| RANGE="" | |
| else | |
| RANGE="$LAST_TAG..HEAD" | |
| fi | |
| git log $RANGE --pretty=format:"* %s%n> %b%n" --reverse > release_notes.txt | |
| # Escape % for GH Actions env file | |
| sed 's/%/%25/g; s/\r/%0D/g; s/\n/%0A/g' release_notes.txt > release_notes_escaped.txt | |
| echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV | |
| cat release_notes_escaped.txt >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| - name: Create release and upload installer | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: nightly-${{ env.COMMIT_HASH }} | |
| tag_name: nightly-${{ env.COMMIT_HASH }} | |
| body: | | |
| ${{ env.RELEASE_NOTES }} | |
| Note that this release is automated per COMMIT. Stability may vary. | |
| files: installer/OpenCMDInstaller.exe | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |