-
Notifications
You must be signed in to change notification settings - Fork 1
181 lines (158 loc) · 8.02 KB
/
Copy pathBuild.yml
File metadata and controls
181 lines (158 loc) · 8.02 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
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
171
172
173
174
175
176
177
178
179
180
181
# This is a basic workflow to help you get started with Actions
name: Build
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, beta, test-workflow ]
tags: [ release-v*, release-b*, release-e*]
pull_request:
branches: [ master, beta ]
# will be triggered when undrafting or requesting review
types: [review_requested, ready_for_review]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Build:
# The type of runner that the job will run on
runs-on: windows-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repositiory
uses: actions/checkout@v3.1.0
- name: submodules-init
# You may pin to the exact commit or the version.
# uses: snickerbockers/submodules-init@74927a8bb0fe1bb0f1f1e4d102384a8e69f19171
uses: snickerbockers/submodules-init@v4
- name: Read tag name
uses: olegtarasov/get-tag@v2.1
id: tagName
- name: Read configuration file
id: dotenv
# You may pin to the exact commit or the version.
# uses: falti/dotenv-action@cb77e3cb51b636f6833ceeb6928bf06ff66e82fa
uses: falti/dotenv-action@v0.2.5
with:
# the path to the .env file (including file name)
path: .github/resources/config.env
# whether to log the variables to output or not
log-variables: true # optional, default is false
- name: Set environment variables
run: >-
echo "ARTIFACT_NAME=Improved Combat AI ${{steps.dotenv.outputs.mod_version}} for Bannerlord ${{steps.dotenv.outputs.game_version}}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
# additional .net core for md2html package.
- name: Setup .NET Core 2.2.x
uses: actions/setup-dotnet@master
with:
dotnet-version: '2.2.x'
# additional .net core for DepotDownloader.
- name: Setup .NET Core 6.0.x
uses: actions/setup-dotnet@master
with:
dotnet-version: '6.0.x'
- name: setup-msbuild
uses: microsoft/setup-msbuild@v1
# with:
# Folder location of where vswhere.exe is located if a self-hosted agent
# vswhere-path: # optional
# Version of Visual Studio to search; defaults to latest if not specified
# vs-version: # optional
- name: Setup NuGet.exe for use with actions
# You may pin to the exact commit or the version.
# uses: NuGet/setup-nuget@04b0c2b8d1b97922f67eca497d7cf0bf17b8ffe1
uses: NuGet/setup-nuget@v1.0.5
- name: Download DepotDownloader_3.4.0
uses: i3h/download-release-asset@v1.3.3
with:
owner: SteamRE
repo: DepotDownloader
tag: DepotDownloader_3.4.0
file: DepotDownloader-windows-x64.zip
- name: Extract DepotDownloader_3.4.0
uses: DuckSoft/extract-7z-action@v1.0
with:
pathSource: DepotDownloader-windows-x64.zip
pathTarget: depotdownloader
- name: Download Bannerlord binaries 1
run: depotdownloader/DepotDownloader.exe -app 261550 -depot 261551 -branch ${{steps.dotenv.outputs.game_version}} -username ${{secrets.STEAM_LOGIN}} -password ${{secrets.STEAM_PASSWORD}} -filelist ./.github/resources/FileFilters.regexp -dir bannerlord;
- name: Download Bannerlord binaries 2
run: depotdownloader/DepotDownloader.exe -app 261550 -depot 261552 -branch ${{steps.dotenv.outputs.game_version}} -username ${{secrets.STEAM_LOGIN}} -password ${{secrets.STEAM_PASSWORD}} -filelist ./.github/resources/FileFilters.regexp -dir bannerlord;
- name: Build Solution
run: >-
nuget restore .\source\ImprovedCombatAI.sln;
MSBuild.exe .\source\ImprovedCombatAI.sln /p:Configuration=Release /p:GamePath="$PWD\bannerlord\";
- name: Generate html files
run: >-
dotnet md2html -i ..\..\README.md -o ..\package\ImprovedCombatAI\README.html;
dotnet md2html -i ..\..\README.zh-CN.md -o ..\package\ImprovedCombatAI\README.zh-CN.html;
dotnet md2html -i ..\..\CHANGELOG.md -o ..\package\ImprovedCombatAI\CHANGELOG.html;
working-directory: .\source\ImprovedCombatAI\
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
# Artifact name
name: ${{env.ARTIFACT_NAME}} ${{steps.dotenv.outputs.game_branch}}
# A file, directory or wildcard pattern that describes what to upload
path: .\source\package\*
# The desired behavior if no files are found using the provided path
- name: Zip Output
run: Compress-Archive -Path .\source\package\* -DestinationPath "${{env.ARTIFACT_NAME}}.zip";
if: >-
contains(github.ref, 'refs/tags/release-v') ||
contains(github.ref, 'refs/tags/release-b') ||
contains(github.ref, 'refs/tags/release-e')
- name: Create a Release
id: create_release
uses: actions/create-release@v1.1.4
if: >-
contains(github.ref, 'refs/tags/release-v') ||
contains(github.ref, 'refs/tags/release-b') ||
contains(github.ref, 'refs/tags/release-e')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The name of the tag. This should come from the webhook payload, `github.GITHUB_REF` when a user pushes a new tag
tag_name: ${{ steps.tagName.outputs.tag }}
# The name of the release. For example, `Release v1.0.1`
release_name: Release ${{env.ARTIFACT_NAME}} ${{steps.dotenv.outputs.game_branch}}
# Text describing the contents of the tag.
# body: # optional
# Path to file with information about the tag.
# body_path: # optional
# `true` to create a draft (unpublished) release, `false` to create a published one. Default: `false`
# draft: # optional
# `true` to identify the release as a prerelease. `false` to identify the release as a full release. Default: `false`
# prerelease: # optional
# Any branch or commit SHA the Git tag is created from, unused if the Git tag already exists. Default: SHA of current commit
# commitish: # optional
# Owner of the repository if it is not the current one
# owner: # optional
# Repository on which to release. Used only if you want to create the release on another repo
# repo: # optional
- name: Upload a Release Asset
uses: actions/upload-release-asset@v1.0.2
if: >-
contains(github.ref, 'refs/tags/release-v') ||
contains(github.ref, 'refs/tags/release-b') ||
contains(github.ref, 'refs/tags/release-e')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# The URL for uploading assets to the release
upload_url: ${{ steps.create_release.outputs.upload_url }}
# The path to the asset you want to upload
asset_path: ${{env.ARTIFACT_NAME}}.zip
# The name of the asset you want to upload
asset_name: ${{env.ARTIFACT_NAME}} ${{steps.dotenv.outputs.game_branch}}.zip
# The content-type of the asset you want to upload. See the supported Media Types here: https://www.iana.org/assignments/media-types/media-types.xhtml for more information
asset_content_type: application/zip