Skip to content

Use last 4 digits of run ID for versioning #4

Use last 4 digits of run ID for versioning

Use last 4 digits of run ID for versioning #4

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
variables:
runs-on: windows-latest
outputs:
version_suffix: ${{ steps.get_version_suffix.outputs.suffix }}
steps:
- name: Generating version suffix
uses: actions/github-script@v7
id: get_version_suffix
with:
script: |
core.setOutput('suffix', "${{ github.run_id }}".substr(-4, 4));
build:
needs: [variables]
runs-on: windows-latest
env:
Solution_Path: Dota2GSI\Dota2GSI.sln
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore $env:Solution_Path
- name: Build
run: dotnet build $env:Solution_Path --no-restore -c Release -p:VersionSuffix=.${{ needs.variables.outputs.version_suffix }}