-
-
Notifications
You must be signed in to change notification settings - Fork 211
68 lines (65 loc) · 2.86 KB
/
common-run-build.yaml
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
name: "common / build"
on:
workflow_call:
env:
CACHE_REV: "1"
jobs:
build:
# Only run on PRs if the source branch is on someone else's repo
if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}"
runs-on: ubuntu-22.04
steps:
- name: setup
id: setup
uses: SpongePowered/.github/.github/actions/setup-java-env@master
with:
runtime_version: 21
publishing_branch_regex: 'api-\d+'
- name: setup / cache minecraft dependencies
uses: "actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9" # v4.0.2
with:
path: |
${{ github.workspace}}/buildSrc/.gradle/
${{ github.workspace}}/.gradle/
key: "${{ runner.os }}-minecraft-${{ env.CACHE_REV }}-${{ hashFiles('**/*.gradle*') }}"
restore-keys: |
${{ runner.os }}-minecraft-${{ env.CACHE_REV }}-
- name: setup / environment
run: |
echo "GIT_COMMIT=${GITHUB_SHA}" >> $GITHUB_ENV
echo "GIT_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
- name: build with Gradle
run: ./gradlew -Pprojects=vanilla,forge,neoforge,testplugins build --stacktrace
env:
CI_SYSTEM: Github Actions
- name: Archive artifacts for build
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
with:
name: Sponge Jars
path: |
${{ github.workspace }}/SpongeAPI/build/libs/*.jar
${{ github.workspace }}/build/libs/*.jar
${{ github.workspace }}/vanilla/build/libs/*.jar
${{ github.workspace }}/forge/build/libs/*.jar
${{ github.workspace }}/neoforge/build/libs/*.jar
- name: SpongeVanilla Production Jar
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
with:
name: SpongeVanilla Production Jar
path: "${{ github.workspace }}/vanilla/build/libs/*-universal.jar"
- name: SpongeForge Production Jar
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
with:
name: SpongeForge Production Jar
path: "${{ github.workspace }}/forge/build/libs/*-universal.jar"
- name: SpongeNeo Production Jar
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
with:
name: SpongeNeo Production Jar
path: "${{ github.workspace }}/neoforge/build/libs/*-universal.jar"
- name: SpongeVanilla libraries
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
with:
name: SpongeVanilla installer libraries
path: "${{ github.workspace }}/vanilla/build/resources/installer/libraries.json"