-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRocketModFix.Unturned.Redist.Matrix.yaml
More file actions
115 lines (106 loc) · 4.28 KB
/
RocketModFix.Unturned.Redist.Matrix.yaml
File metadata and controls
115 lines (106 loc) · 4.28 KB
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: RocketModFix.Unturned.Redist.Matrix
on:
push:
branches: [ master ]
paths:
- 'redist/redist-*/**'
workflow_dispatch:
inputs:
variant:
description: 'Which variant to update'
required: true
type: choice
options:
- all
- client
- client-preview
- client-preview-old
- client-preview-publicized
- client-publicized
- server
- server-preview
- server-preview-old
- server-preview-publicized
- server-publicized
jobs:
build:
name: "Build ${{ matrix.variant }}"
runs-on: ubuntu-22.04
continue-on-error: true
strategy:
matrix:
include:
# Client variants
- variant: "client"
nuspec_path: "redist/redist-client/RocketModFix.Unturned.Redist.Client.nuspec"
trigger_path: "redist/redist-client/**"
- variant: "client-preview"
nuspec_path: "redist/redist-client-preview/RocketModFix.Unturned.Redist.Client.nuspec"
trigger_path: "redist/redist-client-preview/**"
- variant: "client-preview-old"
nuspec_path: "redist/redist-client-preview-old/RocketModFix.Unturned.Redist.Client.nuspec"
trigger_path: "redist/redist-client-preview-old/**"
- variant: "client-preview-publicized"
nuspec_path: "redist/redist-client-preview-publicized/RocketModFix.Unturned.Redist.Client.nuspec"
trigger_path: "redist/redist-client-preview-publicized/**"
- variant: "client-publicized"
nuspec_path: "redist/redist-client-publicized/RocketModFix.Unturned.Redist.Client.nuspec"
trigger_path: "redist/redist-client-publicized/**"
# Server variants
- variant: "server"
nuspec_path: "redist/redist-server/RocketModFix.Unturned.Redist.Server.nuspec"
trigger_path: "redist/redist-server/**"
- variant: "server-preview"
nuspec_path: "redist/redist-server-preview/RocketModFix.Unturned.Redist.Server.nuspec"
trigger_path: "redist/redist-server-preview/**"
- variant: "server-preview-old"
nuspec_path: "redist/redist-server-preview-old/RocketModFix.Unturned.Redist.Server.nuspec"
trigger_path: "redist/redist-server-preview-old/**"
- variant: "server-preview-publicized"
nuspec_path: "redist/redist-server-preview-publicized/RocketModFix.Unturned.Redist.Server.nuspec"
trigger_path: "redist/redist-server-preview-publicized/**"
- variant: "server-publicized"
nuspec_path: "redist/redist-server-publicized/RocketModFix.Unturned.Redist.Server.nuspec"
trigger_path: "redist/redist-server-publicized/**"
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
# Fetches all history for the tj-actions/changed-files to work correctly on push
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47
with:
files: |
${{ matrix.trigger_path }}
- name: Determine if this variant should run
id: check
run: |
SHOULD_RUN=false
# For manual triggers, check the input
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
if [[ "${{ github.event.inputs.variant }}" == "all" || "${{ github.event.inputs.variant }}" == "${{ matrix.variant }}" ]]; then
SHOULD_RUN=true
fi
# For push triggers, use the changed-files output
elif [[ "${{ github.event_name }}" == "push" ]]; then
if [[ "${{ steps.changed-files.outputs.any_changed }}" == "true" ]]; then
SHOULD_RUN=true
fi
fi
echo "should_run=$SHOULD_RUN" >> $GITHUB_OUTPUT
- name: Setup NuGet
if: steps.check.outputs.should_run == 'true'
uses: nuget/setup-nuget@v2
with:
nuget-api-key: ${{ secrets.NUGET_DEPLOY_KEY }}
- name: NuGet Pack & Push
if: steps.check.outputs.should_run == 'true'
uses: ./.github/actions/nuget-pack
id: nuget-pack
with:
nuspec_path: ${{ matrix.nuspec_path }}
nuget_key: ${{ secrets.NUGET_DEPLOY_KEY }}
nuget_push: true