forked from Nincodedo/Banners4BM
-
Notifications
You must be signed in to change notification settings - Fork 3
64 lines (51 loc) · 1.84 KB
/
build.yml
File metadata and controls
64 lines (51 loc) · 1.84 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
name: build
on: [workflow_dispatch, pull_request, push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Run python script to generate specific changelog and env vars
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Run Python script
run: python .github/workflows/generate.py
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v5
- name: Setup JDK ${{env.JAVA_VERSION}}
uses: actions/setup-java@v4
with:
java-version: ${{env.JAVA_VERSION}}
distribution: 'microsoft'
- name: Make gradle wrapper executable
run: chmod +x ./gradlew
- name: Build project
run: ./gradlew build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: bluemap-banners-${{env.VERSION}}
path: build/libs/
# Publish release to Modrinth and GitHub, when tag is present
- name: Publish to Modrinth and GitHub
uses: Kir-Antipov/mc-publish@v3.3
if: startsWith(github.ref, 'refs/tags/')
with:
name: "${{env.NAME}}"
version: "v${{env.VERSION}}"
version-type: release
game-versions: "${{env.MINECRAFT_VERSION}}"
loaders: fabric
files: "build/libs/bluemap-banners-${{env.VERSION}}.jar"
# Config for Modrinth
modrinth-id: rx2aSILw
modrinth-token: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
modrinth-changelog-file: modrinth-changelog.md
# Config for GitHub
github-token: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
github-tag: "v${{env.VERSION}}"
github-changelog-file: github-changelog.md
fail-mode: warn