Skip to content

SIT Build Release

SIT Build Release #27

Workflow file for this run

name: SIT Build Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
build:
permissions: write-all
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
env:
SolutionName: StayInTarkov
CSProj: Source/StayInTarkov.csproj
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the .NET Core workload
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
# Restore all projects
- name: dotnet Restore
run: dotnet restore
# Publish the Launcher as Self-Contained Single-File
- name: dotnet Publish
run: |
mkdir ${{ env.SolutionName }}-${{ matrix.configuration }}
dotnet build ${{ env.CSProj }} -c ${{ matrix.configuration }} -o ${{ env.SolutionName }}-${{ matrix.configuration }}
- name: Get version from DLL
id: extract-version
run: |
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("${{ env.SolutionName }}-${{ matrix.configuration }}\StayInTarkov.dll").ProductVersion
echo "::set-output name=VERSION::$version"
- name: Remove unnecessary files
run: |
del ${{ env.SolutionName }}-${{ matrix.configuration }}\StayInTarkov.pdb
#- name: Display Version in Logs
# run: echo "The extracted version is ${{ steps.extract-version.outputs.VERSION }}"
- name: Zip remaining files
run: |
Compress-Archive -Path ${{ env.SolutionName }}-${{ matrix.configuration }} -DestinationPath ${{ env.SolutionName }}-${{ matrix.configuration }}.zip
# Upload artifact unless its merge to master
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: StayInTarkov-${{ matrix.configuration }}
path: ${{ env.SolutionName }}-${{ matrix.configuration }}\
if-no-files-found: error
#- name: Set build date
# run: |
# $NOW=& Get-Date -format yyyy-MM-dd-HH-mm
# echo "NOW=$NOW" >> $env:GITHUB_ENV
# Create release as draft from the compressed file
- name: Create Release
uses: softprops/action-gh-release@v1
if: ${{ matrix.configuration == 'Release' }}
with:
draft: true
generate_release_notes: true
files: ${{ env.SolutionName }}-${{ matrix.configuration }}.zip
tag_name: StayInTarkov.Client-${{ steps.extract-version.outputs.VERSION }}