Skip to content

Build nwserver Image 8193.36 #3

Build nwserver Image 8193.36

Build nwserver Image 8193.36 #3

Workflow file for this run

name: Build nwserver Image 8193.36
on:
workflow_dispatch:
#schedule:
# - cron: '0 0 * * 5'
jobs:
nwserver:
name: Build nwserver 8193.36
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: "Checkout source code"
uses: "actions/checkout@v3"
with:
fetch-depth: 0
token: ${{ secrets.GH_ACCESS_TOKEN }}
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v2
with:
platforms: |
arm64
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_ACCESS_TOKEN }}
- uses: actions/setup-dotnet@v2
with:
dotnet-version: '6.0.x'
- name: Clone SteamRE/DepotDownloader
run: |
gh repo clone SteamRE/DepotDownloader
- name: Install unzip
run: |
sudo apt install unzip
- name: Install Neverwinter.nim
run: |
wget -O nwn-nim.zip https://github.com/niv/neverwinter.nim/releases/download/1.5.9/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: Install Peres
run: |
sudo apt install pev
- name: Install semver tool
run: |
wget -O /usr/local/bin/semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
chmod +x /usr/local/bin/semver
# 8193.35
- name: Download stable nwn:ee files
id: nwn
env:
APP_ID: 704450
BUILD_ID: 12924695
WIN_BIN_DEPOT_ID: 704452
LINUX_BIN_DEPOT_ID: 704454
CONTENT_DEPOT_ID: 704451
NWN_ROOT: ./
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 $APP_ID -depot $LINUX_BIN_DEPOT_ID -username ${{ secrets.STEAM_USER }} -password ${{ secrets.STEAM_PASS }} -betapassword previewpreview -beta preview
dotnet run -app $APP_ID -depot $WIN_BIN_DEPOT_ID -username ${{ secrets.STEAM_USER }} -password ${{ secrets.STEAM_PASS }} -betapassword previewpreview -beta preview
dotnet run -app $APP_ID -depot $CONTENT_DEPOT_ID -username ${{ secrets.STEAM_USER }} -password ${{ secrets.STEAM_PASS }} -betapassword previewpreview -beta preview
cd depots/$CONTENT_DEPOT_ID/$BUILD_ID/
nwn_resman_pkg --userdirectory . -d $GITHUB_WORKSPACE/nwserver/docker_data/data/data
cd $GITHUB_WORKSPACE
cp DepotDownloader/DepotDownloader/depots/$LINUX_BIN_DEPOT_ID/$BUILD_ID/bin/linux-x86/nwserver-linux nwserver/docker_data/data/bin/linux-amd64/nwserver
cp DepotDownloader/DepotDownloader/depots/$WIN_BIN_DEPOT_ID/$BUILD_ID/bin/win32/nwserver.exe nwserver.exe
cp DepotDownloader/DepotDownloader/depots/$LINUX_BIN_DEPOT_ID/$BUILD_ID/bin/linux-arm64/nwserver-linux nwserver/docker_data/data/bin/linux-arm64/nwserver
cp DepotDownloader/DepotDownloader/depots/$CONTENT_DEPOT_ID/$BUILD_ID/data/cacert.pem nwserver/docker_data/data/data/cacert.pem
cp DepotDownloader/DepotDownloader/depots/$CONTENT_DEPOT_ID/$BUILD_ID/lang/en/data/dialog.tlk nwserver/docker_data/lang/en/data/dialog.tlk
cp -r scripts/. nwserver/docker_data/
cp -r DockerDemo.mod nwserver/
echo now=$(date '+%Y%m%d') >> $GITHUB_OUTPUT
sed -r "s/[12][0-9]{3}[01][0-9][0-3][0-9]/$(date '+%Y%m%d')/g" README.md > README.md.tmp
mv -f README.md.tmp README.md
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
# docker
- name: Bookworm docker image
uses: docker/build-push-action@v3
with:
context: nwserver
file: Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
build-args: |
DEBIAN_VERSION=bookworm-slim
NWN_IMAGE_BUILD_DATE=${{ steps.nwn.outputs.now }}
NWN_VERSION=${{ steps.nwn.outputs.version }}
labels: |
org.opencontainers.image.source=https://github.com/urothis/nwserver
com.nwn.revision=${{ steps.nwn.outputs.version }}
com.nwn.version=${{ steps.nwn.outputs.version }}
com.nwn.description="docker image for running a Neverwinter Nights 1 server on Linux"
tags: |
urothis/nwserver:${{ steps.nwn.outputs.version }}-bookworm
urothis/nwserver:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}-bookworm
urothis/nwserver:${{ steps.nwn.outputs.major }}-bookworm
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.version }}-bookworm
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}-bookworm
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}-bookworm
- name: Bullseye docker image
uses: docker/build-push-action@v3
with:
context: nwserver
file: Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
build-args: |
DEBIAN_VERSION=bullseye-slim
NWN_IMAGE_BUILD_DATE=${{ steps.nwn.outputs.now }}
NWN_VERSION=${{ steps.nwn.outputs.version }}
labels: |
org.opencontainers.image.source=https://github.com/urothis/nwserver
com.nwn.revision=${{ steps.nwn.outputs.version }}
com.nwn.version=${{ steps.nwn.outputs.version }}
com.nwn.description="docker image for running a Neverwinter Nights 1 server on Linux"
tags: |
urothis/nwserver:${{ steps.nwn.outputs.version }}-bullseye
urothis/nwserver:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}-bullseye
urothis/nwserver:${{ steps.nwn.outputs.major }}-bullseye
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.version }}-bullseye
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}-bullseye
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}-bullseye
- name: Buster docker image
uses: docker/build-push-action@v3
with:
context: nwserver
file: Dockerfile
platforms: |
linux/amd64
linux/arm64
push: true
build-args: |
DEBIAN_VERSION=buster-slim
NWN_IMAGE_BUILD_DATE=${{ steps.nwn.outputs.now }}
NWN_VERSION=${{ steps.nwn.outputs.version }}
labels: |
org.opencontainers.image.source=https://github.com/urothis/nwserver
com.nwn.revision=${{ steps.nwn.outputs.version }}
com.nwn.version=${{ steps.nwn.outputs.version }}
com.nwn.description="docker image for running a Neverwinter Nights 1 server on Linux"
tags: |
urothis/nwserver:${{ steps.nwn.outputs.version }}
urothis/nwserver:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}
urothis/nwserver:${{ steps.nwn.outputs.major }}
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.version }}
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}
urothis/nwserver:${{ steps.nwn.outputs.version }}-buster
urothis/nwserver:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}-buster
urothis/nwserver:${{ steps.nwn.outputs.major }}-buster
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.version }}-buster
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}.${{ steps.nwn.outputs.minor }}-buster
ghcr.io/${{ github.repository }}:${{ steps.nwn.outputs.major }}-buster
# commit updated README
- name: Commit updated README
uses: EndBug/add-and-commit@v9
with:
add: README.md
message: "Update README.md"
author_name: urothis
author_email: urothis@gmail.com
github_token: ${{ secrets.GH_ACCESS_TOKEN }}