Skip to content

Commit c795ecf

Browse files
committed
Add a manual build workflow and JAR creation modular workflow
1 parent 7492a0d commit c795ecf

File tree

2 files changed

+150
-0
lines changed

2 files changed

+150
-0
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# REQUIRES DATAGEN TO BE CALLED IN A JOB BEFORE THIS!!
2+
3+
name: Make Release JAR
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
version:
9+
required: true
10+
type: string
11+
12+
jobs:
13+
publish:
14+
name: Publish Code as Releasable JAR - ${{ inputs.version }}
15+
runs-on: ubuntu-22.04
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
submodules: true
21+
22+
- name: Set up JDK
23+
uses: actions/setup-java@v4
24+
with:
25+
distribution: temurin
26+
java-version: 21
27+
28+
- name: Setup Gradle
29+
uses: gradle/actions/setup-gradle@v4
30+
31+
- name: Pull Built Generated Data
32+
uses: actions/download-artifact@v4
33+
with:
34+
name: generated-data
35+
path: neoforge-main/src/generated/resources
36+
37+
- name: Pull Compilation Data (Core)
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: build-core
41+
path: core-api/build
42+
43+
- name: Pull Compilation Data (Main)
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: build-main
47+
path: neoforge-main/build
48+
49+
- name: JAR
50+
run: ./gradlew :neoforge-main:jar
51+
env:
52+
VERSION: ${{ inputs.version }}
53+
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Store Built Assets
57+
if: success()
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: release-jars
61+
path: neoforge-main/build/libs

.github/workflows/manual-build.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Continuous Integration + Announcement
2+
3+
env:
4+
GH_PKG_URL: "https://maven.pkg.github.com/${{ github.repository }}"
5+
6+
permissions:
7+
contents: write # For creating and pushing the tag
8+
9+
on:
10+
workflow_call:
11+
inputs:
12+
version:
13+
required: true
14+
type: string
15+
default: 'v7.0.0'
16+
run_tests:
17+
required: true
18+
type: boolean
19+
default: 'true'
20+
add_version_tag:
21+
required: true
22+
type: boolean
23+
default: 'false'
24+
release_packages:
25+
required: true
26+
type: boolean
27+
default: 'false'
28+
announce:
29+
required: true
30+
type: boolean
31+
default: 'false'
32+
release_cf:
33+
required: true
34+
type: boolean
35+
default: 'false'
36+
37+
jobs:
38+
datagen:
39+
uses: ./.github/workflows/_datagen.yml
40+
secrets: inherit
41+
with:
42+
version: ${{ inputs.version }}
43+
44+
tests:
45+
needs: [datagen]
46+
if: ${{ inputs.run_tests == 'true' }}
47+
uses: ./.github/workflows/_run-gametests.yml
48+
secrets: inherit
49+
with:
50+
version: ${{ inputs.version }}
51+
52+
publish:
53+
if: ${{ inputs.release_packages == 'true' }}
54+
needs: [ tests]
55+
uses: ./.github/workflows/_publish.yml
56+
secrets: inherit
57+
with:
58+
version: ${{ inputs.version }}
59+
60+
create-tag:
61+
name: Create tag
62+
needs: [publish]
63+
if: ${{ inputs.add_version_tag == 'true' }}
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Create tag
67+
uses: actions/github-script@v7
68+
with:
69+
script: |
70+
github.rest.git.createRef({
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
ref: 'refs/tags/releases/v${{ inputs.version }}',
74+
sha: context.sha
75+
})
76+
77+
announce:
78+
name: Discord Announcement
79+
if: ${{ inputs.announce == 'true' }}
80+
needs: [ publish ]
81+
uses: ./.github/workflows/_announce-latest-build.yml
82+
secrets: inherit
83+
84+
release-cf:
85+
name: Release Alpha on CurseForge
86+
if: ${{ inputs.release_cf == 'true' }}
87+
needs: [ publish ]
88+
uses: ./.github/workflows/_release-cf-alpha.yml
89+
secrets: inherit

0 commit comments

Comments
 (0)