Skip to content

Migrate to softprops-action-gh-release #6

Migrate to softprops-action-gh-release

Migrate to softprops-action-gh-release #6

Workflow file for this run

name: Build
on:
push:
branches: [ main, automatic-releases ]
pull_request:
branches: [ main ]
jobs:
build-windows:
runs-on: windows-2022
permissions: write-all
strategy:
matrix:
include:
- build-flavour: debug
output-subdir: _output
- build-flavour: debugoptimized
output-subdir: _output
- build-flavour: release
output-subdir: _output
steps:
- name: Setup variables
uses: actions/github-script@v6
with:
script: core.exportVariable('GITHUB_SHA_SHORT', context.sha.substring(0, 7))
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Meson
run: pip install meson==0.64.1
- name: Build
shell: pwsh
run: |
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
. .\build_bridge_${{matrix.build-flavour}}.bat
- name: Copy readme
run: copy artifacts_readme.txt _output
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: bridge-remix-${{env.GITHUB_SHA_SHORT}}-${{github.run_number}}-${{matrix.build-flavour}}
path: |
_output\*.dll
_output\*.exe
_output\*.pdb
_output\*.txt
_output\.trex\*.dll
_output\.trex\*.exe
_output\.trex\*.pdb
- name: Create clean directory for CI/CD release
shell: pwsh
run: |
New-Item ".\_upload" -Type Directory
cd ".\_upload"
Get-ChildItem -Path "..\_output" -Recurse -Filter *.pdb | Copy-Item
Get-ChildItem -Path "..\_output" -Recurse -Filter *.dll | Copy-Item
Get-ChildItem -Path "..\_output" -Recurse -Filter *.exe | Copy-Item
New-Item ".\.trex" -Type Directory
cd ".\.trex"
Get-ChildItem -Path "..\NvRemixBridge.*" | Move-Item
cd "..\.."
Compress-Archive -Path ".\_upload\*" -DestinationPath "bridge-remix-${{env.GITHUB_SHA_SHORT}}-${{github.run_number}}-${{matrix.build-flavour}}.zip"
- name: "Prune automatic releases to latest"
uses: dev-drprasad/[email protected]
with:
keep_latest: 3
delete_tag_pattern: automatic # defaults to ""
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: "Create new CI/CD release"
uses: softprops/action-gh-release@v1
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "automatic-${{matrix.build-flavour}}"
prerelease: true
generate_release_notes: true
title: "bridge-remix-${{env.GITHUB_SHA_SHORT}}-${{github.run_number}}-${{matrix.build-flavour}}"
files: |
*.zip
_upload/*.txt