-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (81 loc) · 3.6 KB
/
build.yaml
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
name: Build, package, release
on:
pull_request:
push:
branches:
- main
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get Valheim version id
id: valheimversion
run: echo "::set-output name=valheimversion::$(curl -s https://api.steamcmd.net/v1/info/896660 | jq -r '.data.\"896660\".depots.branches.public.buildid')"
- name: Get BepInEx version
id: bepinexversion
run: echo "::set-output name=bepinexversion::$(./scripts/get-dep-version.sh denikson-BepInExPack_Valheim)"
- name: Get build commands
run: scripts/install-linux-tools.sh
- name: Install NuGet dependencies
run: |
# Fixes weird permission errors that started in GitHub Actions
# environments on June 14th:
sudo chown -R $USER /tmp/NuGetScratch/
nuget restore Pokeheim.sln
- name: Cache Valheim
id: cachevalheim
uses: actions/cache@v2
with:
path: ~/VHINSTALL
key: ${{ steps.valheimversion.outputs.valheimversion }}-${{ hashFiles('**/lockfiles') }}-BepInExPack-${{ steps.bepinexversion.outputs.bepinexversion }}
- name: Install SteamCMD
if: steps.cachevalheim.outputs.cache-hit != 'true'
uses: CyberAndrii/setup-steamcmd@v1
- name: Prepare Pokeheim dependencies
if: steps.cachevalheim.outputs.cache-hit != 'true'
run: |
wget -O bepinex.zip "https://valheim.thunderstore.io/package/download/denikson/BepInExPack_Valheim/${{ steps.bepinexversion.outputs.bepinexversion }}/"
unzip bepinex.zip -d ~/BepInExRaw
steamcmd +login anonymous +force_install_dir ~/VHINSTALL +app_update 896660 validate +exit
mv ~/VHINSTALL/valheim_server_Data/ ~/VHINSTALL/valheim_Data/
mv ~/BepInExRaw/BepInExPack_Valheim/* ~/VHINSTALL/
wget -O mountup.zip "https://valheim.thunderstore.io/package/download/Oran1/Mountup/3.2.9/"
unzip mountup.zip -d ~/VHINSTALL/BepInEx/plugins/
- name: Remove old DLLs
run: |
rm -rf ~/VHINSTALL/valheim_server_Data/Managed/publicized_assemblies
rm -rf ~/VHINSTALL/BepInEx/plugins/MMHOOK
- name: Set references to DLLs
run: |
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><Project ToolsVersion=\"Current\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\"><PropertyGroup><VALHEIM_INSTALL>$HOME/VHINSTALL/</VALHEIM_INSTALL></PropertyGroup></Project>" > Environment.props
- name: Build debug version
run: ./scripts/build.sh Debug
# Set the version to the tag, if this was a tag push.
- name: Prepare release
if: startsWith(github.ref, 'refs/tags/')
run: |
RELEASE_VERSION=$(echo "${{ github.ref }}" | sed -e 's@refs/tags/@@')
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "Setting release version to $RELEASE_VERSION"
# Set a dummy default version for CI builds generated on every push or on
# pull requests.
- name: Build release zip
run: |
RELEASE_VERSION="${RELEASE_VERSION:-0.0.1}" ./scripts/package.sh
- uses: actions/upload-artifact@v2
with:
# Will result in Pokeheim.zip
name: Pokeheim
# Everything in this folder will be archived, but not the folder
path: staging/
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: Pokeheim.zip