Skip to content

Commit 3f99e2f

Browse files
committed
test ci
1 parent 400f41a commit 3f99e2f

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

.github/workflows/butler.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Build Unity Project
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
16+
- name: Install Butler
17+
run: |
18+
curl -LO https://itch.io/butler/installation/linux/installer.sh
19+
chmod +x installer.sh
20+
./installer.sh
21+
22+
- name: Set up Unity
23+
uses: game-ci/unity-builder@v2
24+
with:
25+
unityVersion: 2022.3.27f1
26+
targetPlatform: StandaloneWindows64
27+
28+
- name: Build Unity Project
29+
run: |
30+
unity-builder --projectPath . --buildTarget StandaloneWindows64 --buildName MyGameBuild --outputPath ./build
31+
32+
- name: Zip Build Output
33+
run: |
34+
powershell -Command "Compress-Archive -Path ./build/* -DestinationPath subnauticaib.zip"
35+
36+
- name: Get Latest Tag
37+
id: get_tag
38+
run: |
39+
git fetch --tags
40+
latest_tag=$(git tag --sort=-v:refname | head -n 1)
41+
echo "latest_tag=${latest_tag}" >> $GITHUB_ENV
42+
43+
- name: Increment Version
44+
id: increment_version
45+
run: |
46+
if [[ "${{ env.latest_tag }}" == "" ]]; then
47+
echo "version=1.0.0" >> $GITHUB_ENV
48+
else
49+
version=$(echo "${{ env.latest_tag }}" | awk -F. -v OFS=. '{$NF++;print}')
50+
echo "version=${version}" >> $GITHUB_ENV
51+
fi
52+
53+
- name: Upload to Butler
54+
run: |
55+
butler push subnauticaib.zip pyoneerc1/subnauticaib:latest --userversion ${{ env.version }} --credentials ${{ secrets.BUTLER_CREDENTIALS }}

0 commit comments

Comments
 (0)