-
Notifications
You must be signed in to change notification settings - Fork 7
170 lines (142 loc) · 5.09 KB
/
reloaded.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
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# Script to build and publish a Reloaded Mod.
# by Sewer56
# Produces:
# - Build to Upload to GameBanana
# - Build to Upload to GitHub
# - Build to Upload to NuGet
# - Changelog
# When pushing a tag
# - Upload to GitHub Releases
# - Upload to Reloaded NuGet Repository (if GitHub Secret RELOADED_NUGET_KEY is specified)
name: Build and Publish Reloaded Mod
on:
push:
branches: [ master ]
tags:
- '*'
pull_request:
branches: [ master ]
workflow_dispatch:
env:
PUBLISH_COMMON_PATH: ./Publish/ToUpload/
PUBLISH_GAMEBANANA_UE_PATH: ./Publish/ToUpload/UnrealEssentials/GameBanana
PUBLISH_GITHUB_UE_PATH: ./Publish/ToUpload/UnrealEssentials/Generic
PUBLISH_NUGET_UE_PATH: ./Publish/ToUpload/UnrealEssentials/NuGet
PUBLISH_GAMEBANANA_UTOC_PATH: ./Publish/ToUpload/UTOC.Stream.Emulator/GameBanana
PUBLISH_GITHUB_UTOC_PATH: ./Publish/ToUpload/UTOC.Stream.Emulator/Generic
PUBLISH_NUGET_UTOC_PATH: ./Publish/ToUpload/UTOC.Stream.Emulator/NuGet
PUBLISH_INTERFACE_PATH: ./Publish/Interface
NUGET_URL: https://api.nuget.org/v3/index.json
PUBLISH_CHANGELOG_PATH: ./CHANGELOG.md
PUBLISH_PATH: ./Publish
RELOADEDIIMODS: .
# Default value is official Reloaded package server.
RELOAD_NUGET_URL: http://packages.sewer56.moe:5000/v3/index.json
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/') }}
RELEASE_TAG: ${{ github.ref_name }}
jobs:
build:
runs-on: windows-latest
defaults:
run:
shell: pwsh
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: 'recursive'
- name: Setup .NET Core SDK (5.0)
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 5.0.x
- name: Setup .NET Core SDK (6.0)
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 6.0.x
- name: Setup .NET Core SDK (7.0)
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 7.0.x
- name: Setup .NET Core SDK (8.0)
uses: actions/setup-dotnet@v1.8.2
with:
dotnet-version: 8.0.x
- name: Setup Rust
uses: hecrj/setup-rust-action@v2.0.1
with:
rust-version: nightly
components: rust-src
targets: x86_64-pc-windows-msvc
- name: Build
run: ./PublishAll.ps1
- name: Upload GitHub Release Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: GitHub Release
# A file, directory or wildcard pattern that describes what to upload
path: |
${{ env.PUBLISH_GITHUB_UE_PATH }}/*
${{ env.PUBLISH_GITHUB_UTOC_PATH }}/*
- name: Upload GameBanana Release Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: GameBanana Release
# A file, directory or wildcard pattern that describes what to upload
path: |
${{ env.PUBLISH_GAMEBANANA_UE_PATH }}/*
${{ env.PUBLISH_GAMEBANANA_UTOC_PATH }}/*
- name: Upload NuGet Release Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: NuGet Release
# A file, directory or wildcard pattern that describes what to upload
path: |
${{ env.PUBLISH_NUGET_UE_PATH }}/*
${{ env.PUBLISH_NUGET_UTOC_PATH }}/*
- name: Upload Changelog Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: Changelog
# A file, directory or wildcard pattern that describes what to upload
path: ${{ env.PUBLISH_CHANGELOG_PATH }}
retention-days: 0
- name: Upload Interfaces Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: Interfaces
# A file, directory or wildcard pattern that describes what to upload
path: ${{ env.PUBLISH_INTERFACE_PATH }}
retention-days: 0
- name: Upload to GitHub Releases (on Tag)
uses: softprops/action-gh-release@v0.1.14
if: env.IS_RELEASE == 'true'
with:
# Path to load note-worthy description of changes in release from
body_path: ${{ env.PUBLISH_CHANGELOG_PATH }}
# Newline-delimited list of path globs for asset files to upload
files: |
${{ env.PUBLISH_GITHUB_UE_PATH }}/*
${{ env.PUBLISH_GITHUB_UTOC_PATH }}/*
- name: Push to NuGet (on Tag)
env:
NUGET_KEY: ${{ secrets.RELOADED_NUGET_KEY }}
INTERFACE_NUGET_KEY: ${{ secrets.INTERFACE_NUGET_KEY }}
if: env.IS_RELEASE == 'true'
run: |
$items = Get-ChildItem -Path "$env:PUBLISH_COMMON_PATH/*.nupkg"
Foreach ($item in $items)
{
Write-Host "Pushing $item"
dotnet nuget push "$item" -k "$env:NUGET_KEY" -s "$env:RELOAD_NUGET_URL" --skip-duplicate
}
$items = Get-ChildItem -Path "$env:PUBLISH_INTERFACE_PATH/*.nupkg"
Foreach ($item in $items)
{
Write-Host "Pushing $item"
dotnet nuget push "$item" -k "$env:INTERFACE_NUGET_KEY" -s "$env:NUGET_URL" --skip-duplicate
}