-
Notifications
You must be signed in to change notification settings - Fork 0
184 lines (183 loc) · 9.11 KB
/
36.yml
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
182
183
184
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: 12880199
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 }}