Skip to content

Add copy/paste audit #141

Add copy/paste audit

Add copy/paste audit #141

Workflow file for this run

name: .NET
on: [push]
jobs:
build:
runs-on: windows-2019
permissions:
contents: read
id-token: write # For federated auth
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: setup-msbuild
uses: microsoft/[email protected]
# Restore NuGet
- name: Setup NuGet.exe for use with actions
uses: NuGet/[email protected]
- name: Generate NuGet Cache Key
id: nuget_cache_key
run: powershell -Command echo "key=nuget-cache-$((Get-FileHash -InputStream ([IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes((Select-String -Path "*/*.csproj" -Pattern "PackageReference" | foreach {$_.line.Trim()} | Sort-Object))))).Hash)" >> $env:GITHUB_OUTPUT
- name: Cache Nuget
uses: actions/cache@v3
with:
key: ${{ steps.nuget_cache_key.outputs.key }}
path: ~/.nuget/packages
- name: Restore dependencies
run: msbuild /p:Configuration=Release -t:restore DedicatedServerWrapper.sln
# Bootstrap
- name: Build Bootstrap
run: msbuild /p:Configuration=Release Meds.Bootstrap/Meds.Bootstrap.csproj
- name: Package Bootstrap
run: |
mkdir Meds.Wrapper/bin/package/
cp Meds.Bootstrap/bin/Release/Meds.Bootstrap.exe Meds.Wrapper/bin/package/
cp Meds.Bootstrap/config.example.xml Meds.Wrapper/bin/package/config.xml
- name: Upload Bootstrap
uses: actions/upload-artifact@v3
with:
name: meds-bootstrap
path: Meds.Wrapper/bin/package/
# Shared
- name: Build FlatBuffers
run: msbuild /p:Configuration=Release Meds.Shared/Meds.Shared.csproj /t:FlatcCompile
- name: Build Shared
run: msbuild /p:Configuration=Release Meds.Shared/Meds.Shared.csproj
# Watchdog
- name: Build Watchdog
run: msbuild /p:Configuration=Release Meds.Watchdog/Meds.Watchdog.csproj
# Wrapper
- name: Generate ME cache key
id: me_cache_key
run: powershell -Command echo "key=me-cache-v1-$(Get-Date -Format yyyy-MM)" >> $env:GITHUB_OUTPUT
- name: Cache ME
uses: actions/cache@v3
with:
key: ${{ steps.me_cache_key.outputs.key }}
restore-keys: |
me-cache-v1-
path: Meds.Wrapper/GameInstall/
- name: Install ME
run: Meds.Watchdog/bin/Release/Meds.Watchdog.exe restore-game-binaries Meds.Wrapper/GameInstall/ communityedition
- name: Build wrapper
run: msbuild /p:Configuration=Release Meds.Wrapper/Meds.Wrapper.csproj
# Publish to GCS
- name: Log into gcloud
id: auth
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && github.event_name != 'pull_request'
uses: 'google-github-actions/auth@v0'
with:
workload_identity_provider: 'projects/445692247363/locations/global/workloadIdentityPools/github-actions/providers/github-actions'
service_account: '[email protected] '
- name: Upload Wrapper Release
uses: 'google-github-actions/upload-cloud-storage@v1'
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && github.event_name != 'pull_request'
with:
path: Meds.Wrapper/bin/Release
destination: "meds-dist/${{github.ref}}/wrapper"
parent: false
headers: |-
cache-control: public, max-age=300, must-revalidate
- name: Upload Watchdog Release
uses: 'google-github-actions/upload-cloud-storage@v1'
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && github.event_name != 'pull_request'
with:
path: Meds.Watchdog/bin/Release
destination: "meds-dist/${{github.ref}}/watchdog"
parent: false
headers: |-
cache-control: public, max-age=300, must-revalidate