Skip to content

build trigger

build trigger #39

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: [ "main" ]
paths:
- '**/Si_*/**'
- '!*.md'
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
generateInputPaths:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Generate matrix with all modules of the repo
id: set-matrix
run: |
echo "::set-output name=matrix::$(ls -l | grep '^d' | awk -F ' ' '{print $9}' | grep -Po 'Si.*' | jq -R -s -c 'split("\n") | map(select(length > 0))')"
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
# checklinks:
# needs: generateInputPaths
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# path: ${{ fromJson(needs.generateInputPaths.outputs.matrix) }}
# steps:
# - uses: actions/checkout@v2
# - name: Print Directory Structure
# run: |
# ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
build:
needs: generateInputPaths
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
path: ${{ fromJson(needs.generateInputPaths.outputs.matrix) }}
steps:
- name: Prepare environment sha
shell: bash
run: echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Prepare environment pwd
shell: bash
run: echo "START_DIR=`pwd`" >> $GITHUB_ENV
- uses: actions/checkout@v3
- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: |
cd ${{ matrix.path }}
dotnet restore
- name: Build
run: |
cd ${{ matrix.path }}
dotnet build --no-restore -c Release
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.path }}-build-${{ env.GITHUB_SHA_SHORT }}
path: ${{ matrix.path }}/bin/${{env.BUILD_TYPE}}/**/*.dll
- uses: actions/upload-artifact@v3
with:
name: dedicated-server-${{ env.GITHUB_SHA_SHORT }}
path: ${{ env.START_DIR }}/**/bin/${{env.BUILD_TYPE}}/netstandard2.1/*.dll
- uses: actions/upload-artifact@v3
with:
name: listen-server-${{ env.GITHUB_SHA_SHORT }}
path: ${{ env.START_DIR }}/**/bin/${{env.BUILD_TYPE}}/net6.0/*.dll