-
-
Notifications
You must be signed in to change notification settings - Fork 24
164 lines (132 loc) · 5.02 KB
/
publish.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
name: Gradle Package
on:
push:
branches:
- main
jobs:
build-linux:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Clone repo
uses: actions/checkout@v3
- name: Replace build number
run: sed -i "s/SNAPSHOT/${{ github.run_number }}/g" ./src/main/java/legend/core/Version.java
- name: Replace commit hash
run: sed -i "s/COMMIT/${{ github.sha }}/g" ./src/main/java/legend/core/Version.java
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Publish to maven local
run: ./gradlew publishToMavenLocal
- name: Clone meta scraper
uses: actions/checkout@v4
with:
repository: Legend-of-Dragoon-Modding/Severed-Chains-Metadata-Utility
path: meta
- name: Build meta scraper
working-directory: ./meta
run: ./gradlew build
- name: Run meta scraper
env:
HOST: ${{ secrets.META_HOST }}
USERNAME: ${{ secrets.META_USERNAME }}
PASSWORD: ${{ secrets.META_PASSWORD }}
working-directory: ./patches/meta
run: java --add-exports java.base/jdk.internal.access=ALL-UNNAMED --add-opens java.base/jdk.internal.access=ALL-UNNAMED --add-exports java.base/jdk.internal.reflect=ALL-UNNAMED -jar ../../meta/build/libs/sc-meta-scraper-1.0.jar --host "$HOST" --username "$USERNAME" --password "$PASSWORD"
- name: Build Windows x64 with Gradle
run: ./gradlew build -Pos=windows -Parch=x86_64
- name: Write ISOs help file
run: mkdir ./build/libs/isos && echo "Place your ISOs or BINs in this folder" > ./build/libs/isos/help.txt
- name: ZIP Windows x64 Build
uses: thedoctor0/zip-release@main
with:
type: 'zip'
filename: '../Severed_Chains_Windows.zip'
directory: 'build/libs'
exclusions: '*.zip* *.tar.gz*'
- name: Clean up Windows x64
run: 'rm build/libs/launch.bat'
- name: Build Steam Deck x64 with Gradle
run: ./gradlew build -Pos=linux -Parch=x86_64 -Psteamdeck=true
- name: ZIP Steam Deck x64 Build
uses: thedoctor0/zip-release@main
with:
type: 'tar'
filename: '../Severed_Chains_Steam_Deck.tar.gz'
directory: 'build/libs'
exclusions: '*.zip* *.tar.gz*'
- name: Clean up Steam Deck x64
run: 'rm build/libs/launch build/libs/download-java'
- name: Build Linux x64 with Gradle
run: ./gradlew build -Pos=linux -Parch=x86_64
- name: ZIP Linux x64 Build
uses: thedoctor0/zip-release@main
with:
type: 'tar'
filename: '../Severed_Chains_Linux.tar.gz'
directory: 'build/libs'
exclusions: '*.zip* *.tar.gz*'
- name: Clean up Linux x64
run: 'rm build/libs/launch build/libs/download-java'
- name: Build Linux ARM64 with Gradle
run: ./gradlew build -Pos=linux -Parch=aarch64
- name: ZIP Linux ARM64 Build
uses: thedoctor0/zip-release@main
with:
type: 'tar'
filename: '../Severed_Chains_Linux_ARM64.tar.gz'
directory: 'build/libs'
exclusions: '*.zip* *.tar.gz*'
- name: Clean up Linux ARM64
run: 'rm build/libs/launch build/libs/download-java'
- name: Build MacOS x64 with Gradle
run: ./gradlew build -Pos=osx -Parch=x86_64
- name: ZIP MacOS x64 Build
uses: thedoctor0/zip-release@main
with:
type: 'tar'
filename: '../Severed_Chains_MacOS_Intel.tar.gz'
directory: 'build/libs'
exclusions: '*.zip* *.tar.gz*'
- name: Clean up MacOS x64
run: 'rm build/libs/launch build/libs/download-java'
- name: Build MacOS ARM64 with Gradle
run: ./gradlew build -Pos=osx -Parch=aarch64
- name: ZIP MacOS ARM64 Build
uses: thedoctor0/zip-release@main
with:
type: 'tar'
filename: '../Severed_Chains_MacOS_M1.tar.gz'
directory: 'build/libs'
exclusions: '*.zip* *.tar.gz*'
- name: Clean up MacOS ARM64 x64
run: 'rm build/libs/launch build/libs/download-java'
- name: Delete Tag and Release
uses: dev-drprasad/[email protected]
with:
delete_release: 'true'
tag_name: 'devbuild'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Release
uses: ncipollo/release-action@v1
with:
artifacts: 'build/*.zip,build/*.tar.gz'
token: ${{ secrets.GITHUB_TOKEN }}
commit: ${{ github.sha }}
name: 'Latest Development Build'
allowUpdates: 'true'
prerelease: 'true'
tag: 'devbuild'