-
-
Notifications
You must be signed in to change notification settings - Fork 20
124 lines (104 loc) · 3.9 KB
/
release.yml
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
name: Build Plazma
on:
push:
branches: [ "ver/*", "feat/*", "dev/*", "expr/*", "ench/*", "impl/*" ]
workflow_dispatch:
env:
ORG_NAME: PlazmaMC
MC_VERSION: 1.20.1
MAIN_BRANCH: old/1.20.1
DEBUG: 'false'
jobs:
release:
strategy:
matrix:
base_jdk: [17]
os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout javadocs
uses: actions/checkout@v4
if: github.ref_name == env.MAIN_BRANCH
with:
repository: PlazmaMC/Javadocs
path: javadoc
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up GraalVM ${{ matrix.base_jdk }}
uses: graalvm/setup-graalvm@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: ${{ matrix.base_jdk }}
version: latest
cache: 'gradle'
- name: Configure Git
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
- name: Apply Patches
run: ./gradlew applyPatches --stacktrace
- name: Build
run: ./gradlew build --stacktrace
- name: Create Reobf Jar
run: ./gradlew createReobfPaperclipJar --stacktrace
- name: Create Mojmap Jar
run: ./gradlew createMojmapPaperclipJar --stacktrace
- name: Update Javadoc
continue-on-error: true
if: github.ref_name == env.MAIN_BRANCH
run: |
(cd Plazma-API/build/docs/javadoc && tar c .) | (cd javadoc && tar xf -)
cd javadoc
git add . && git commit -m "Update Javadocs"
git push
- name: Publish Packages
if: github.ref_name == env.MAIN_BRANCH
run: |
export GITHUB_USERNAME=${{ env.ORG_NAME }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish --stacktrace
- name: Upload Artifacts
if: "!startsWith(github.ref_name, 'ver/')"
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: |
build/libs
Plazma-API/build/docs/javadoc
- name: Get Release Number
if: startsWith(github.ref_name, 'ver/')
run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV
- name: Release Artifacts
if: startsWith(github.ref_name, 'ver/')
uses: softprops/[email protected]
with:
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }}
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
- name: Release Artifacts (Latest/Stable)
if: startsWith(github.ref_name, 'ver/')
uses: softprops/[email protected]
with:
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
- name: Release Artifacts (Latest/Development)
if: startsWith(github.ref_name, 'dev/')
uses: softprops/[email protected]
with:
name: "Development Build for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
prerelease: false