Skip to content

Commit cf77a87

Browse files
committed
feat(ci): setup ci
1 parent 4586f0d commit cf77a87

File tree

7 files changed

+457
-23
lines changed

7 files changed

+457
-23
lines changed

.github/renovate.json5

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"extends": [
3+
":enableRenovate",
4+
":semanticCommits",
5+
":enablePreCommit",
6+
"config:best-practices"
7+
],
8+
"platform": "github",
9+
"onboarding": false,
10+
"requireConfig": "optional",
11+
"timezone": "UTC",
12+
"dependencyDashboard": true,
13+
"platformCommit": true,
14+
"prCreation": "not-pending",
15+
"suppressNotifications": ["prIgnoreNotification"],
16+
"rebaseWhen": "conflicted",
17+
"packageRules": [
18+
{"matchUpdateTypes": ["major"], "addLabels": ["dependency/major"]},
19+
{"matchUpdateTypes": ["minor"], "addLabels": ["dependency/minor"]},
20+
{"matchUpdateTypes": ["patch"], "addLabels": ["dependency/patch"]}
21+
]
22+
}

.github/workflows/flex-build.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
name: Flex Build
3+
4+
"on":
5+
workflow_call:
6+
inputs:
7+
mc:
8+
description: Minecraft version
9+
type: string
10+
lex:
11+
description: LexForge version
12+
type: string
13+
neo:
14+
description: NeoForge version
15+
type: string
16+
java:
17+
description: Java version
18+
required: true
19+
type: string
20+
upload:
21+
description: Upload the build artifacts
22+
default: true
23+
type: boolean
24+
publish:
25+
description: Run Gradle publish
26+
default: false
27+
type: boolean
28+
29+
jobs:
30+
build: # TODO: add build attestation and generate then combine gradle dependency graphs for SBOM
31+
name: Build ${{ inputs.mc }}
32+
runs-on: blacksmith-2vcpu-ubuntu-2204
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 1
38+
39+
- name: Cache build
40+
id: cache
41+
uses: useblacksmith/cache@v5
42+
with:
43+
path: build
44+
key: build-${{ hashFiles(format('{0}/[a-z]**', inputs.mc), 'api/**') }}
45+
46+
- if: steps.cache.outputs.cache-hit != 'true'
47+
name: Setup Java
48+
uses: useblacksmith/setup-java@v5
49+
with:
50+
distribution: temurin
51+
java-version: ${{ inputs.java }}
52+
53+
- if: steps.cache.outputs.cache-hit != 'true'
54+
name: Setup Gradle
55+
uses: useblacksmith/setup-gradle/setup-gradle@v5
56+
with:
57+
workflow-job-context: '{}' # FIXME: avoid this cache duplication workaround
58+
59+
- if: |
60+
steps.cache.outputs.cache-hit != 'true'
61+
&& !inputs.release
62+
name: Gradle build
63+
run: >
64+
./gradlew build --stacktrace
65+
-Pminecraft_version=${{ inputs.mc }}
66+
-Plexforge_version=${{ inputs.lex }}
67+
-Pneoforge_version=${{ inputs.neo }}
68+
69+
- if: inputs.release
70+
name: Gradle publish
71+
env:
72+
IS_MAVEN_PUB: true
73+
DEPLOY_TO_GITHUB_PACKAGES_URL: https://maven.pkg.github.com/${{ github.repository }}
74+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
75+
run: ./gradlew publish
76+
77+
- if: inputs.upload
78+
name: Upload artifacts
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: jars-${{ inputs.mc }}
82+
path: build/libs/*.jar

0 commit comments

Comments
 (0)