From 4bcd39e9159e40149b0977402fb4135ce6c928d5 Mon Sep 17 00:00:00 2001 From: Austin Vandersluis Date: Mon, 1 Jan 2024 06:39:08 -0800 Subject: [PATCH] Add workflow build --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++++++++ src/Oxide.References.csproj | 36 +++++++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..96042bd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,38 @@ +name: Build + +on: + push: + branches: + - master + - develop + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + + - name: Extract branch name + shell: pwsh + run: | + $branch = $env:GITHUB_REF -replace 'refs/heads/', '' + echo "BRANCH_NAME=$branch" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + if ( $branch == 'develop' ) { + echo "BUILD=Debug" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + } else { + echo "BUILD=Release" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + } + + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + + - name: Build + run: dotnet build --nologo /p:Configuration=${{ env.BUILD }} /p:Version=1.0.$env:GITHUB_RUN_ID + + - name: Upload Artifacts + uses: actions/upload-artifacts@v3 + with: + name: ${{ github.event.repository.name }} + path: src/bin/${{ env.BUILD }}/ diff --git a/src/Oxide.References.csproj b/src/Oxide.References.csproj index 2586408..b428a95 100644 --- a/src/Oxide.References.csproj +++ b/src/Oxide.References.csproj @@ -24,6 +24,16 @@ + + + + + + + + + + @@ -35,10 +45,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + - +