|
| 1 | +#<shared> |
| 2 | + |
| 3 | +definitions: |
| 4 | + default-defaults: &default-defaults |
| 5 | + run: |
| 6 | + shell: bash |
| 7 | + |
| 8 | + checkout: &checkout |
| 9 | + uses: actions/checkout@v4 |
| 10 | + with: |
| 11 | + fetch-depth: '0' |
| 12 | + |
| 13 | + setup-dotnet: &setup-dotnet |
| 14 | + name: Setup .NET |
| 15 | + uses: actions/setup-dotnet@v3 |
| 16 | + with: |
| 17 | + dotnet-version: | |
| 18 | + 8.x |
| 19 | + 9.x |
| 20 | +
|
| 21 | + setup-nuget: &setup-nuget |
| 22 | + name: Setup NuGet |
| 23 | + run: | |
| 24 | + dotnet nuget update source csgals --store-password-in-clear-text --username CSGALS --password ${{ secrets.GITHUB_TOKEN }} |
| 25 | + dotnet nuget enable source csgals |
| 26 | +
|
| 27 | + restore: &restore |
| 28 | + name: Restore |
| 29 | + run: dotnet restore |
| 30 | + |
| 31 | + build: &build |
| 32 | + name: Build |
| 33 | + run: dotnet build --configuration Release --no-restore |
| 34 | + |
| 35 | + test: &test |
| 36 | + name: Test |
| 37 | + run: dotnet test --configuration Debug --logger GitHubActions -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura |
| 38 | + |
| 39 | + pack: &pack |
| 40 | + name: Pack |
| 41 | + run: dotnet pack -p:PackageOutputPath="$(pwd)/artifacts" --configuration Release --no-restore |
| 42 | + |
| 43 | + upload-artifacts: &upload-artifacts |
| 44 | + name: Upload Artifacts |
| 45 | + uses: actions/upload-artifact@v4 |
| 46 | + if: success() || failure() |
| 47 | + with: |
| 48 | + name: artifacts |
| 49 | + if-no-files-found: error |
| 50 | + path: | |
| 51 | + artifacts/* |
| 52 | +
|
| 53 | + download-artifacts: &download-artifacts |
| 54 | + name: Download Artifacts |
| 55 | + uses: actions/download-artifact@v4 |
| 56 | + with: |
| 57 | + path: artifacts |
| 58 | + pattern: '*' |
| 59 | + merge-multiple: true |
| 60 | + |
| 61 | + publish-github: &publish-github |
| 62 | + name: Publish NuGet GitHub |
| 63 | + run: dotnet nuget push 'artifacts/*.nupkg' -k ${{ secrets.GITHUB_TOKEN }} -s csgals --skip-duplicate --no-symbols |
| 64 | + |
| 65 | + build-css-package: &build-css-package |
| 66 | + name: 'Build CSS Package' |
| 67 | + run: | |
| 68 | + src="./src/CSSUniversalMenuAPI/bin/Release/net8.0" |
| 69 | + dst="./artifacts/CSSUniversalMenuAPI" |
| 70 | + dst_shared="$dst/addons/counterstrikesharp/shared/CSSUniversalMenuAPI" |
| 71 | + mkdir -p "$dst_shared" |
| 72 | + cp "$src/CSSUniversalMenuAPI.dll" "$dst_shared/" |
| 73 | + cp "$src/CSSUniversalMenuAPI.deps.json" "$dst_shared/" |
| 74 | + pushd "$dst" |
| 75 | + 7z a ../CSSUniversalMenuAPI.zip ./ |
| 76 | + popd |
| 77 | +
|
| 78 | + empty: "hi" # fixes the yml parser from messing the last value up |
| 79 | + |
| 80 | +#</shared> |
0 commit comments