forked from RypoFalem/ArmorStandEditor
-
Notifications
You must be signed in to change notification settings - Fork 25
136 lines (116 loc) · 4.34 KB
/
nightly-build.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
name: Nightly ASE Build of Main (CI/CD)
on:
schedule:
- cron: "0 23 * * *"
jobs:
nightly-build-java21:
runs-on: ubuntu-latest
strategy:
matrix:
java_version: ['21']
steps:
# Checkout the repository
- name: Checkout ArmorStandEditor
uses: actions/checkout@v4
with:
fetch-depth: 0
# Set up the Java Development Kit (JDK)
- name: Setup JDK ${{ matrix.java_version }}
uses: actions/[email protected]
with:
java-version: ${{ matrix.java_version }}
distribution: 'zulu'
# Cache SonarCloud for analysis
- name: Cache SonarCloud for Analysis
uses: actions/[email protected]
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
# Cache Maven packages to speed up build
- name: Cache the Maven Packages to speed up build
uses: actions/[email protected]
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
# Build and analyze the project using Maven and SonarCloud
- name: Build and analyze via Maven
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=wolfieheart_ArmorStandEditor
# Clean and verify the build
- name: Clean Verify
run: mvn -B clean verify
# Get the current date and time
- name: Get Current Date and Time
id: date
run: echo "DATE=$(date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
# Rename the artifact file with the current date and time
- name: Rename Artifact
run: |
ARTIFACT_PATH=$(find /home/runner/work/ArmorStandEditor/ArmorStandEditor/target/ -name 'armorstandeditor-*-*.jar')
mv $ARTIFACT_PATH "${ARTIFACT_PATH%.jar}-${{ env.DATE }}-Java21.jar"
# Upload the renamed artifact for debugging
- name: Upload Artifact for Debugging
uses: actions/upload-artifact@v4
with:
name: artifact
path: /home/runner/work/ArmorStandEditor/ArmorStandEditor/target/armorstandeditor-*-*-Java21.jar
if-no-files-found: error
retention-days: 1
overwrite: true
# nightly-build-java17:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# java_version: ['17']
# steps:
# # Checkout the repository
# - name: Checkout ArmorStandEditor
# uses: actions/checkout@v4
# with:
# fetch-depth: 0
#
# Set up the Java Development Kit (JDK)
# - name: Setup JDK ${{ matrix.java_version }}
# uses: actions/[email protected]
# with:
# java-version: ${{ matrix.java_version }}
# distribution: 'temurin'
# Cache SonarCloud for analysis
# - name: Cache SonarCloud for Analysis
# uses: actions/[email protected]
# with:
# path: ~/.sonar/cache
# key: ${{ runner.os }}-sonar
# restore-keys: ${{ runner.os }}-sonar
# - name: Cache the Maven Packages to speed up build
# uses: actions/[email protected]
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2
# - name: Build and analyze via Maven
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=wolfieheart_ArmorStandEditor
# - name: Clean Verify
# run: mvn -B clean verify
# - name: Get Current Date and Time
# id: date
# run: echo "DATE=$(date +'%Y-%m-%d_%H-%M-%S')" >> $GITHUB_ENV
# - name: Rename Artifact
# run: |
# ARTIFACT_PATH=$(find /home/runner/work/ArmorStandEditor/ArmorStandEditor/target/ -name 'armorstandeditor-*-*.jar')
# mv $ARTIFACT_PATH "${ARTIFACT_PATH%.jar}-${{ env.DATE }}-Java17.jar"
# - name: Upload Artifact for Debugging
# uses: actions/upload-artifact@v4
# with:
# name: artifact
# path: /home/runner/work/ArmorStandEditor/ArmorStandEditor/target/armorstandeditor-*-*-Java17.jar
# if-no-files-found: error
# retention-days: 1
# overwrite: true