Skip to content

create-release

create-release #27

name: create-release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version number'
required: true
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: windows-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- name: setup-msbuild
uses: microsoft/[email protected]
- run: msbuild ${{ github.event.repository.name }}.sln -t:rebuild -verbosity:diag -property:Configuration=Release -property:Platform=x64
- run: cp x64\Release\${{ github.event.repository.name }}.asi ${{ github.event.repository.name }}.asi
- uses: robinraju/[email protected]
with:
repository: "ThirteenAG/Ultimate-ASI-Loader"
latest: true
fileName: "Ultimate-ASI-Loader_x64.zip"
- name: Prepare Ultimate ASI Loader
run: |
unzip Ultimate-ASI-Loader_x64.zip -d .\
C:\msys64\usr\bin\wget.exe -O .\UltimateASILoader_LICENSE.md https://raw.githubusercontent.com/ThirteenAG/Ultimate-ASI-Loader/master/license
- name: Create Directory Structure
run: |
mkdir .\zip\Steam
mkdir .\zip\Reloaded-II
- name: Prepare Steam/MS files
run: |
cp ${{ github.event.repository.name }}.asi .\zip\Steam\
cp ${{ github.event.repository.name }}.ini .\zip\Steam\
cp dinput8.dll .\zip\Steam\dinput8.dll
cp UltimateASILoader_LICENSE.md .\zip\Steam\
New-Item -Path ".\zip\Steam\EXTRACT_TO_GAME_FOLDER" -ItemType File
- name: Prepare Reloaded-II files
run: |
cp ${{ github.event.repository.name }}.asi .\zip\Reloaded-II\
cp ${{ github.event.repository.name }}.ini .\zip\Reloaded-II\
cp assets\r2-package\ModConfig.json .\zip\Reloaded-II
$pathToJson = ".\zip\Reloaded-II\ModConfig.json"
$version = "${{ github.event.inputs.version }}".TrimStart('v') # Remove 'v' prefix from version
(Get-Content $pathToJson -Raw) -replace '<REPLACED_VERSION_IN_CI>', $version | Set-Content $pathToJson
- name: Create Steam/MS Zip
run: |
cd .\zip\Steam
7z a -r -tzip ..\..\${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip .\*
- name: Create Reloaded-II Zip
run: |
cd .\zip\Reloaded-II
7z a -r -tzip ..\..\${{ github.event.repository.name }}_Reloaded-II.zip .\*
- uses: ncipollo/release-action@v1
with:
artifacts: "${{ github.event.repository.name }}_${{ github.event.inputs.version }}.zip, ${{ github.event.repository.name }}_Reloaded-II.zip"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.event.inputs.version }}
name: "${{ github.event.inputs.version }}"
draft: true
generateReleaseNotes: true
artifactErrorsFailBuild: true