-
Notifications
You must be signed in to change notification settings - Fork 681
191 lines (183 loc) · 7.36 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: 'Release'
on:
release:
types: [ published ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
ARTIFACT_PATH: ${{ steps.prepare_artifact_metadata.outputs.ARTIFACT_PATH }}
ARTIFACT_NAME: ${{ steps.prepare_artifact_metadata.outputs.ARTIFACT_NAME }}
JAVADOC_PATH: ${{ steps.prepare_artifact_metadata.outputs.JAVADOC_PATH }}
JAVADOC_NAME: ${{ steps.prepare_artifact_metadata.outputs.JAVADOC_NAME }}
API_PATH: ${{ steps.prepare_artifact_metadata.outputs.API_PATH }}
API_NAME: ${{ steps.prepare_artifact_metadata.outputs.API_NAME }}
VERSION: ${{ steps.prepare_artifact_metadata.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 50
- run: git fetch origin --tags
shell: bash
- uses: ./.github/actions/gradle-setup
- name: Build with Gradle
run: ./gradlew printProjectVersion build publish -x check --max-workers 1
- name: Prepare artifact metadata. Note that VERSION is set by the gradle script.
id: prepare_artifact_metadata
run: |
echo ARTIFACT_PATH=./build/libs/appliedenergistics2-${VERSION}.jar >> $GITHUB_OUTPUT
echo ARTIFACT_NAME=appliedenergistics2-${VERSION}.jar >> $GITHUB_OUTPUT
echo JAVADOC_PATH=./build/libs/appliedenergistics2-${VERSION}-javadoc.jar >> $GITHUB_OUTPUT
echo JAVADOC_NAME=appliedenergistics2-${VERSION}-javadoc.jar >> $GITHUB_OUTPUT
echo API_PATH=./build/libs/appliedenergistics2-${VERSION}-api.jar >> $GITHUB_OUTPUT
echo API_NAME=appliedenergistics2-${VERSION}-api.jar >> $GITHUB_OUTPUT
echo VERSION=${VERSION} >> $GITHUB_OUTPUT
- name: Archive build results
# It is important to archive .gradle as well since gradle stores the incremental build state there
run: tar -I zstd -cf build.tar.zst build/libs build/repo
- name: Upload build and gradle folders
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: build.tar.zst
if-no-files-found: error
retention-days: 3
upload-release-artifacts:
name: Upload Release Artifacts
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Upload Release Artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ needs.build.outputs.ARTIFACT_PATH }}
asset_name: ${{ needs.build.outputs.ARTIFACT_NAME }}
asset_content_type: application/zip
- name: Upload Javadocs Artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ needs.build.outputs.JAVADOC_PATH }}
asset_name: ${{ needs.build.outputs.JAVADOC_NAME }}
asset_content_type: application/zip
- name: Upload API
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ needs.build.outputs.API_PATH }}
asset_name: ${{ needs.build.outputs.API_NAME }}
asset_content_type: application/zip
deploy-github-packages:
name: Deploy to Github Packages
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Publish to Github Packages
uses: AppliedEnergistics/maven-publish-action@main
with:
local-repository-path: build/repo
remote-repository-url: https://maven.pkg.github.com/AppliedEnergistics/Applied-Energistics-2/
remote-repository-username: ${{ github.actor }}
remote-repository-password: ${{ github.token }}
deploy-curseforge:
name: Deploy to Curseforge
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Upload to Curseforge
uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659
with:
name: AE2 ${{ needs.build.outputs.VERSION }} [NEOFORGE]
version: ${{ needs.build.outputs.VERSION }}
files: ${{ needs.build.outputs.ARTIFACT_PATH }}
dependencies: |
jade(optional){modrinth:nvQzSEkH}{curseforge:324717}
wthit(optional){modrinth:6AQIaxuO}{curseforge:440979}
rei(optional){modrinth:nfn13YXA}{curseforge:310111}
emi(optional){modrinth:fRiHVvU7}{curseforge:580555}
optifine(incompatible)
theoneprobe(optional){modrinth:Eyw0UxEx}{curseforge:245211}
curseforge-id: 223794
curseforge-token: ${{ secrets.CURSEFORGE }}
loaders: neoforge
deploy-modmaven:
name: Deploy to Modmaven
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Publish to Modmaven
uses: AppliedEnergistics/maven-publish-action@main
with:
local-repository-path: build/repo
remote-repository-url: https://modmaven.dev/artifactory/local-releases/
remote-repository-username: ${{ secrets.MODMAVEN_USER }}
remote-repository-password: ${{ secrets.MODMAVEN_PASSWORD }}
deploy-modrinth:
name: Deploy to Modrinth
needs: build
runs-on: ubuntu-latest
steps:
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: build-artifacts
- name: Unpack build artifact
run: tar axf build.tar.zst
- name: Validate artifacts exist
run: test -d ./build
- name: Upload to Modrinth
uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659
with:
name: AE2 ${{ needs.build.outputs.VERSION }} [NEOFORGE]
version: ${{ needs.build.outputs.VERSION }}
files: ${{ needs.build.outputs.ARTIFACT_PATH }}
dependencies: |
jade(optional){modrinth:nvQzSEkH}{curseforge:324717}
wthit(optional){modrinth:6AQIaxuO}{curseforge:440979}
rei(optional){modrinth:nfn13YXA}{curseforge:310111}
emi(optional){modrinth:fRiHVvU7}{curseforge:580555}
optifine(incompatible)
theoneprobe(optional){modrinth:Eyw0UxEx}{curseforge:245211}
modrinth-id: XxWD5pD3
modrinth-token: ${{ secrets.MODRINTH }}
loaders: neoforge