Skip to content

.NET build

.NET build #8

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 build
on:
#push:
# branches: [ "main" ]
#pull_request:
# branches: [ "main" ]
workflow_dispatch:
inputs:
artifact-name:
required: false
type: string
default: 'nupkg'
# make this action reusable
workflow_call:
inputs:
artifact-name:
required: false
type: string
default: 'nupkg'
outputs:
artifact-name:
value: ${{ inputs.artifact-name }}
env:
artifact-retention-days: 7
unity-folder: 'SatorImaging.StaticMemberAnalyzer.Unity'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: |
cd src
dotnet restore
- name: Build
run: |
cd src
dotnet build -c Release --no-restore
#- name: Test
# run: dotnet test --no-build --verbosity normal
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.artifact-name }}
path: 'src/**/*.nupkg'
retention-days: ${{ env.artifact-retention-days }}
- name: Commit for Unity
continue-on-error: false
run: |
ls -al "src/StaticMemberAnalyzer.Package/bin/Release/"
ls -al "src/StaticMemberAnalyzer.Package/bin/Release/**/*"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
mv -f "src/StaticMemberAnalyzer.Package/bin/Release/*/*.dll" "${{ env.unity-folder }}"
git add --update --ignore-removal "${{ env.unity-folder }}/**/*"
git commit -m "Precompiled Assembly for Unity"
git push