-
-
Notifications
You must be signed in to change notification settings - Fork 28
166 lines (150 loc) · 6.85 KB
/
main.yml
File metadata and controls
166 lines (150 loc) · 6.85 KB
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
name: BlockBall
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master, development ]
pull_request:
branches: [ master, development ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
Build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '8'
- name: Build Java Application
env:
SHYNIXN_MCUTILS_REPOSITORY_2026: ${{ secrets.SHYNIXN_MCUTILS_REPOSITORY_2026 }}
run: |
chmod +x gradlew
./gradlew build mcPluginJars
for f in build.gradle build.gradle.kts; do
if [ -f "$f" ]; then
sed -i 's|// HTOnly ||g' "$f" || true
fi
done
./gradlew build htPluginJars
echo "RELEASE_VERSION=$(./gradlew -q printVersion)" >> $GITHUB_ENV
- name: Create Geyser Customizations
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
env:
GEYSER_PASSWORD: ${{ secrets.GEYSER_PASSWORD }}
run: |
7z x docs/resources/BlockBall-GeyserMC.7z -p${{ env.GEYSER_PASSWORD }}
- name: Create Github Release
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: "This release was automatically created by Github Actions. Please wait until the author manually sets the patchnotes for this release."
tag_name: ${{ env.RELEASE_VERSION }}
release_name: Release ${{ env.RELEASE_VERSION }}
draft: true
prerelease: false
- name: Upload Latest Bukkit Release to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/build/libs/blockball-root-${{ env.RELEASE_VERSION }}-latest.jar
asset_name: BlockBall.jar
asset_content_type: application/jar
- name: Upload Premium Bukkit Release to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/build/libs/blockball-root-${{ env.RELEASE_VERSION }}-premium.jar
asset_name: BlockBall-Premium.jar
asset_content_type: application/jar
- name: Upload Premium Folia Release to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/build/libs/blockball-root-${{ env.RELEASE_VERSION }}-premium-folia.jar
asset_name: BlockBall-Premium-Folia.jar
asset_content_type: application/jar
- name: Upload Legacy Bukkit Release to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/build/libs/blockball-root-${{ env.RELEASE_VERSION }}-legacy.jar
asset_name: BlockBall-Legacy.jar
asset_content_type: application/jar
- name: Upload Hytale Latest Release to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/build/libs/blockball-root-${{ env.RELEASE_VERSION }}-hytale-latest.jar
asset_name: BlockBall-Hytale.jar
asset_content_type: application/jar
- name: Upload Hytale Premium Release to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/build/libs/blockball-root-${{ env.RELEASE_VERSION }}-hytale-premium.jar
asset_name: BlockBall-Hytale-Premium.jar
asset_content_type: application/jar
- name: Geyser Customizations to Github
if: "contains(github.event.head_commit.message, '--release') && contains(github.ref, 'master')"
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/BlockBall/BlockBall/BlockBall-GeyserMC.zip
asset_name: BlockBall-GeyserMC.zip
asset_content_type: application/zip
Wiki:
runs-on: ubuntu-latest
if: "contains(github.ref, 'master')"
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: '8'
- uses: actions/setup-python@v2
with:
python-version: '3.x'
architecture: 'x64'
- name: Build Documentation
run: |
git pull
git config --global user.email "shynixn@email.com" && git config --global user.name "Shynixn CI Actions"
rm -rf docs/wiki/site
sudo apt-get update
sudo apt-get install -y mkdocs
pip install mkdocs-material
pip install Pygments
cd docs/wiki
mkdocs build
cd ..
cd ..
git add docs
git commit --message "Automatic CI Documentation." || true
git push --quiet https://Shynixn:${{ secrets.GITHUB_TOKEN }}@github.com/Shynixn/BlockBall.git HEAD:master || true