Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: beta / public-test support #31

Merged
merged 3 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build/*
!build/.keep
build-beta/*
vendor/*
!vendor/.keep
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Valheim macOS

[![Valheim version](https://badgen.net/badge/Valheim%20version/0.216.9/green)](https://valheim.com/news/patch-0-216-9)
[![Stable version](https://badgen.net/badge/Stable%20version/0.216.9/green)](https://valheim.com/news/patch-0-216-9)
[![Public Test version](https://badgen.net/badge/Public%20Test%20version/0.217.7/orange)](https://store.steampowered.com/news/app/892970/view/3658659836549833064)

## Background

Expand Down Expand Up @@ -84,8 +85,11 @@ These steps take between 15 to 30 minutes to complete, depending on network spee
3. Run `./build.sh` and follow the instructions.

> __Note__
> The script requires Steam credentials so that Valheim data can be acquired. As the original
> macOS Steam client does not have access to Valheim, this is done via [DepotDownloader].
> The script will ask for Steam credentials so that Valheim data can be acquired. As the original
> macOS Steam client does not have access to Valheim, this is done automatically via [DepotDownloader].

If you would rather use the Public Test build, run `./build.sh --beta` instead. Read the [official Public Test FAQ]
to learn more.

4. Once the build script finishes, verify the presence of `Valheim.app` in the `build` folder.
5. If you are in dire need of disk space: the contents of the `vendor` folder can be safely deleted at this point.
Expand Down Expand Up @@ -182,6 +186,7 @@ Feedback, issues, or pull requests with improvements are more than welcome! 🙏
[browsed online]: https://store.steampowered.com/account/remotestorageapp/?appid=892970
[official Dotnet installer]: https://dotnet.microsoft.com/en-us/download
[official Valheim Twitter account]: https://twitter.com/Valheimgame
[official Public Test FAQ]: https://steamcommunity.com/app/892970/discussions/5/3589961352692584029/
[porting Unity games to different platforms]: https://www.pcgamingwiki.com/wiki/Engine:Unity/Porting
[r/macgaming]: https://www.reddit.com/r/macgaming/comments/1217lko/valheim_macos_build_script/
[the build to be damaged]: https://github.com/timkurvers/valheim-macos/issues/16#issuecomment-1517025125
32 changes: 24 additions & 8 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
#!/bin/bash
# shellcheck disable=SC2002

cd "$(dirname "$0")"

set -e

# Valheim configuration
appid=892970
depotid=892971

# Stable (public)
branch="public"
buildid=11422039
manifestid=9217850553460069452
version="0.216.9"

# Unity configuration
unityversion="2020.3.45f1"
unityhash="660cd1701bd5"
variant="macos_x64_nondevelopment_mono"
outdir="build"

# Beta (public-test)
if [[ " $* " =~ " --beta " ]]; then
branch="public-test"
buildid=11535571
unset manifestid
version="0.217.7"
# unityversion="2020.3.45f1"
# unityhash="660cd1701bd5"
# variant="macos_x64_nondevelopment_mono"
outdir="build-beta"
fi

confirm() {
read -r -p "${1:-Are you sure?} [y/N] " response
Expand Down Expand Up @@ -58,7 +74,7 @@ if [ ! -d "depots/$depotid/$buildid" ]; then

echo -n "Steam username: "
read -r username
dotnet depotdownloader-2.5.0/DepotDownloader.dll -app $appid -depot $depotid -manifest $manifestid -os linux -username "$username"
dotnet depotdownloader-2.5.0/DepotDownloader.dll -app $appid -depot $depotid -manifest $manifestid -beta $branch -os linux -username "$username"
fi

if [ ! -d "depots/$depotid/$buildid/valheim_Data" ]; then
Expand Down Expand Up @@ -108,11 +124,11 @@ fi

cd ..

mkdir -p build
rm -rf build/*
cp -r skeleton/* build/
mkdir -p $outdir
rm -rf ${outdir:?}/*
cp -r skeleton/* $outdir/

prefix="build/Valheim.app/Contents"
prefix="$outdir/Valheim.app/Contents"
unityprefix="vendor/Unity-$unityversion/Unity.pkg.tmp/Payload/Unity/Unity.app/Contents/PlaybackEngines/MacStandaloneSupport"

cat skeleton/Valheim.app/Contents/Info.plist \
Expand Down Expand Up @@ -140,4 +156,4 @@ cp -r vendor/PlayFabParty-for-macOS_v1.7.16/PlayFabParty-for-macOS/PlayFabPartyM
rm -rf $prefix/Resources/Data/Plugins
rm -rf $prefix/Resources/Data/MonoBleedingEdge

echo "Building Valheim $version complete: build/Valheim.app"
echo "Building Valheim $version complete: $outdir/Valheim.app"