-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrelease-base.sh
More file actions
executable file
·31 lines (26 loc) · 925 Bytes
/
release-base.sh
File metadata and controls
executable file
·31 lines (26 loc) · 925 Bytes
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
#!/bin/bash
set -e
set -u
version=$(curl --silent "https://api.steamcmd.net/v1/info/2394010" | jq '.data."2394010".depots.branches.public.buildid' -r)
currentversion=$(cat currentversion)
echo "currentversion:$currentversion version:$version"
# 判断版本号是否相同 如果相同就exit
if [[ "$currentversion" == "$version" ]]; then
exit
fi
echo "Submit Docker Image"
# 登录仓库
docker login -u $DOCKER_USER -p $DOCKER_PWD
# 构建仓库
docker build -f Dockerfile.base -t zhiqiangwang/palworld-server:base .
# 发布仓库
echo "Release Docker Version: " $version
docker push zhiqiangwang/palworld-server:base
echo "Submit the latest code"
# 更新代码
echo "$version" >currentversion
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add currentversion
git commit -a -m "Auto Update to buildid: $version"
git push origin main