Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
urothis committed Dec 30, 2023
1 parent 87e3ccc commit 6b6504f
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 34 deletions.
23 changes: 14 additions & 9 deletions .actions/nwserver/download/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ inputs:
output_path:
description: "Output path"
required: true
default: ${{ github.workspace }}/nwserver
type: string
runs:
using: "composite"
Expand All @@ -32,14 +33,18 @@ runs:
WIN_BIN_DEPOT_ID: 704452
LINUX_BIN_DEPOT_ID: 704454
CONTENT_DEPOT_ID: 704451
NWN_ROOT: ./
run: |
mkdir -p ${{ inputs.output_path }}/nwserver/lang/en/data ${{ inputs.output_path }}/nwserver/data/bin/linux-amd64 ${{ inputs.output_path }}/nwserver/data/bin/linux-arm64 ${{ inputs.output_path }}/nwserver/data/data/mod/
mkdir -p ${{ inputs.output_path }}/lang/en/data ${{ inputs.output_path }}/data/bin/linux-amd64 ${{ inputs.output_path }}/data/bin/linux-arm64 ${{ inputs.output_path }}/nwserver/data/data/mod/
cd DepotDownloader/DepotDownloader
dotnet run -app 704450 -depot ${{ inputs.WIN_BIN_DEPOT_ID }} -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }}
dotnet run -app 704450 -depot ${{ inputs.LINUX_BIN_DEPOT_ID }} -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }}
dotnet run -app 704450 -depot ${{ inputs.CONTENT_DEPOT_ID }} -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }}
cd depots/${{ inputs.CONTENT_DEPOT_ID }}/*/
cp bin/linux-x86/nwserver-linux ${{ inputs.output_path }}/nwserver/docker_data/data/bin/linux-amd64/nwserver
cp bin/win32/nwserver.exe ${{ inputs.output_path }}/nwserver.exe
cp bin/linux-arm64/nwserver-linux ${{ inputs.output_path }}/nwserver/docker_data/data/bin/linux-arm64/nwserver
if [ "${{ inputs.preview }}" = "true" ]; then
EXTRA_ARGS="-betapassword previewpreview -beta preview"
else
EXTRA_ARGS=""
fi
dotnet run -app $APP_ID -depot $WIN_BIN_DEPOT_ID -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} $EXTRA_ARGS
dotnet run -app $APP_ID -depot $LINUX_BIN_DEPOT_ID -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} $EXTRA_ARGS
dotnet run -app $APP_ID -depot $CONTENT_DEPOT_ID -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }} $EXTRA_ARGS
cd depots/$CONTENT_DEPOT_ID/*/
cp bin/linux-x86/nwserver-linux ${{ inputs.output_path }}/data/bin/linux-amd64/nwserver
cp bin/win32/nwserver.exe ${{ inputs.output_path }}/data/bin/win32/nwserver.exe
cp bin/linux-arm64/nwserver-linux ${{ inputs.output_path }}/data/bin/linux-arm64/nwserver
33 changes: 13 additions & 20 deletions .actions/nwserver/package/action.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,28 @@
name: "Parse nwserver"
inputs:
path:
description: "Path"
required: true
default: ${{ github.workspace }}/nwserver
type: string
env:
NWN_ROOT: ${{ inputs.path }}
runs:
using: "composite"
steps:
- uses: "actions/checkout@v3"
- name: Install Dependencies
shell: bash
run: |
sudo apt install unzip pev
wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
chmod +x /usr/local/bin/semver
sudo apt install unzip
wget -O nwn-nim.zip https://github.com/niv/neverwinter.nim/releases/download/1.7.1/neverwinter.linux.amd64.zip
unzip -j nwn-nim.zip nwn_resman_pkg -d /usr/local/bin/
chmod +x /usr/local/bin/nwn_resman_pkg
echo /usr/local/bin/ >> $GITHUB_PATH
- name: Download nwnee files
- name: Package nwnee files
shell: bash
env:
APP_ID: 704450
WIN_BIN_DEPOT_ID: 704452
LINUX_BIN_DEPOT_ID: 704454
CONTENT_DEPOT_ID: 704451
NWN_ROOT: ./
CONTENT_DEPOT_ID: 704451
run: |
mkdir -p nwserver/docker_data/lang/en/data nwserver/docker_data/data/bin/linux-amd64 nwserver/docker_data/data/bin/linux-arm64 nwserver/docker_data/data/data/mod/
cd DepotDownloader/DepotDownloader
dotnet run -app 704450 -depot 704452 -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }}
dotnet run -app 704450 -depot 704454 -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }}
dotnet run -app 704450 -depot 704451 -username ${{ inputs.steam_username }} -password ${{ inputs.steam_password }}
cd depots/704451/11253735/
nwn_resman_pkg --userdirectory . -d $GITHUB_WORKSPACE/nwserver/docker_data/data/data
cd $GITHUB_WORKSPACE
cp DepotDownloader/DepotDownloader/depots/704454/11253735/bin/linux-x86/nwserver-linux nwserver/docker_data/data/bin/linux-amd64/nwserver
cp DepotDownloader/DepotDownloader/depots/704452/11253735/bin/win32/nwserver.exe nwserver.exe
cp DepotDownloader/DepotDownloader/depots/704454/11253735/bin/linux-arm64/nwserver-linux nwserver/docker_data/data/bin/linux-arm64/nwserver
cd depots/$CONTENT_DEPOT_ID/*/
nwn_resman_pkg --userdirectory . -d ${{ inputs.GITHUB_WORKSPACE }}/data/data
10 changes: 5 additions & 5 deletions .actions/nwserver/parse/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
description: "Path to nwserver.exe"
required: true
type: string
default: "nwserver/nwserver.exe"
default: ${{ github.workspace }}/nwserver/data/bin/win32/nwserver.exe
outputs:
version: ${{ steps.nwn.outputs.version }}
major: ${{ steps.nwn.outputs.major }}
Expand All @@ -23,7 +23,7 @@ runs:
id: nwn
shell: bash
run: |
echo version=$(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p) >> $GITHUB_OUTPUT
echo major=$(semver get major $(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT
echo minor=$(semver get minor $(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT
echo patch=$(semver get patch $(peres -v nwserver.exe -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT
echo version=$(peres -v ${{ inputs.path }} -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p) >> $GITHUB_OUTPUT
echo major=$(semver get major $(peres -v ${{ inputs.path }} -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT
echo minor=$(semver get minor $(peres -v ${{ inputs.path }} -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT
echo patch=$(semver get patch $(peres -v ${{ inputs.path }} -f csv | grep -v DEBUG | cut -d'.' -f2- | sed -n 2p)) >> $GITHUB_OUTPUT
5 changes: 5 additions & 0 deletions .github/workflows/nwserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ jobs:
echo "major: ${{ steps.parse.outputs.major }}"
echo "minor: ${{ steps.parse.outputs.minor }}"
echo "patch: ${{ steps.parse.outputs.patch }}"
- name: Package nwserver files
id: package
uses: ./.actions/nwserver/package/
with:
input_path: ${{ github.workspace }}/nwserver

0 comments on commit 6b6504f

Please sign in to comment.