-
Notifications
You must be signed in to change notification settings - Fork 16
84 lines (75 loc) · 2.33 KB
/
Copy pathpublish.yml
File metadata and controls
84 lines (75 loc) · 2.33 KB
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
name: Publish Artifacts
on:
release:
types: [ published ]
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: gradle/actions/wrapper-validation@v5
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 21
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: "IridiumCore"
path: "build/libs/IridiumCore-*.jar"
update-release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Downloading artifact
uses: actions/checkout@v5
- uses: thecodemonkey/action-get-gradle-version@master
id: version
with:
file: "build.gradle.kts"
- uses: actions/download-artifact@v8.0.1
with:
name: "IridiumCore"
path: "./"
- name: Upload release asset
uses: softprops/action-gh-release@v2
with:
files: "IridiumCore-*.jar"
publish-nexus:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- uses: thecodemonkey/action-get-gradle-version@master
id: version
with:
file: "build.gradle.kts"
- name: Download build artifact
uses: actions/download-artifact@v8.0.1
with:
name: "IridiumCore"
path: "./"
- name: Find IridiumCore jar
id: find_jar
run: |
FILE=$(find . -type f -name "IridiumCore-*.jar" | head -n 1)
echo "file=$FILE" >> "$GITHUB_OUTPUT"
- name: Upload to Nexus with curl
run: |
curl --location 'https://nexus.iridiumdevelopment.net/service/rest/v1/components?repository=maven-releases' \
--header 'Authorization: Basic ${{ secrets.NEXUS_AUTH }}' \
-F "maven2.groupId=com.iridium" \
-F "maven2.artifactId=IridiumCore" \
-F "maven2.version=${{ steps.version.outputs.version }}" \
-F "maven2.generate-pom=true" \
-F "maven2.asset1=@${{ steps.find_jar.outputs.file }}" \
-F "maven2.asset1.extension=jar"