forked from MonoGame/MonoGame
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.27 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Build
on: [push, pull_request]
jobs:
build:
name: build-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
fail-fast: false
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: '11'
- name: Disable annotations
run: echo "::remove-matcher owner=csc::"
- name: Install required workloads
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
echo "MICROSOFT SUPPORT ANDROID WORKLOAD ON LINUX PLZZZ!"
elif [ "$RUNNER_OS" == "Windows" ]; then
dotnet.exe workload install android ios macos
else
dotnet workload install android ios macos
fi
shell: bash
- name: Build
run: dotnet run --project build/Build.csproj -- --target=Default
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Upload Artifacts
run: dotnet run --project build/Build.csproj -- --target=UploadArtifacts
env:
ACTIONS_RUNTIME_TOKEN: ${{ env.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_RUNTIME_URL: "${{ env.ACTIONS_RUNTIME_URL }}"
deploy:
name: Deploy
needs: [ build ]
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}
permissions:
packages: write
contents: write
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Push GitHub Nugets
run: dotnet run --project build/Build.csproj -- --target=DeployNuGetsToGithub
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}