2929 cmake_args : ' -DCMAKE_BUILD_TYPE=Release -DARCH=native -DBUILD_SHARED_LIBS=ON'
3030 artifact_name : ' librandomx_macos_x86_64.dylib'
3131 output_lib : ' librandomx_macos_x86_64.dylib'
32- # macOS - aarch64
33- - os : macos-latest
34- arch : aarch64
35- cmake_args : ' -DCMAKE_BUILD_TYPE=Release -DARCH=native -DBUILD_SHARED_LIBS=ON'
36- artifact_name : ' librandomx_macos_aarch64.dylib'
37- output_lib : ' librandomx_macos_aarch64.dylib'
3832 # Windows - x86_64
3933 - os : windows-latest
4034 arch : x86_64
4943 arch : amd64
5044 - os : macos-latest
5145 arch : amd64
46+ # Exclude macOS-aarch64 from GitHub Actions build
47+ - os : macos-latest
48+ arch : aarch64
5249 - os : windows-latest
5350 arch : aarch64
5451 - os : windows-latest
@@ -75,15 +72,34 @@ jobs:
7572 run : |
7673 cd randomx
7774 mkdir build && cd build
75+
76+ echo "Configuring for native compilation"
7877 cmake .. ${{ matrix.cmake_args }}
78+
7979 make -j4
8080 mkdir -p ../../src/main/resources/native
81+
82+ # Platform-specific copy commands with verification
8183 if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
82- cp *.so ../../src/main/resources/native/${{ matrix.output_lib }}
84+ cp -v librandomx.so ../../src/main/resources/native/${{ matrix.output_lib }}
85+ ls -la ../../src/main/resources/native/
8386 elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
84- cp *.dylib ../../src/main/resources/native/${{ matrix.output_lib }}
87+ cp -v librandomx.dylib ../../src/main/resources/native/${{ matrix.output_lib }}
88+ ls -la ../../src/main/resources/native/
8589 elif [[ "${{ matrix.os }}" == "windows-latest" ]]; then
86- cp *.dll ../../src/main/resources/native/${{ matrix.output_lib }}
90+ cp -v librandomx.dll ../../src/main/resources/native/${{ matrix.output_lib }}
91+ ls -la ../../src/main/resources/native/
92+ fi
93+ shell : bash
94+
95+ - name : Verify library file
96+ run : |
97+ echo "Verifying library file in native resources directory"
98+ if [ -f "src/main/resources/native/${{ matrix.output_lib }}" ]; then
99+ echo "✅ Library file ${{ matrix.output_lib }} exists"
100+ else
101+ echo "❌ Library file ${{ matrix.output_lib }} is missing"
102+ exit 1
87103 fi
88104 shell : bash
89105
@@ -100,12 +116,29 @@ jobs:
100116 - name : Checkout code
101117 uses : actions/checkout@v4
102118
103- - name : Download Dynamic Link Library Artifacts
119+ - name : Download all artifacts
104120 uses : actions/download-artifact@v4
105121 with :
106122 path : src/main/resources/native/
107- pattern : librandomx-*
108- - run : ls src/main/resources/native/
123+ merge-multiple : true
124+
125+ - name : Check for Apple Silicon Library
126+ run : |
127+ echo "Checking for macOS ARM64 library (should be precompiled locally)"
128+ if [ -f "src/main/resources/native/librandomx_macos_aarch64.dylib" ]; then
129+ echo "✅ Found precompiled Apple Silicon library"
130+ else
131+ echo "⚠️ WARNING: Apple Silicon library (librandomx_macos_aarch64.dylib) not found!"
132+ echo "⚠️ Please compile this library locally on an Apple Silicon Mac and commit it to the repository."
133+ echo "⚠️ Build will continue but the final JAR will not support Apple Silicon Macs."
134+ fi
135+ shell : bash
136+
137+ - name : List downloaded artifacts
138+ run : |
139+ echo "Contents of native resources directory:"
140+ ls -la src/main/resources/native/
141+ shell : bash
109142
110143 - name : Set up JDK
111144 uses : actions/setup-java@v4
@@ -126,6 +159,8 @@ jobs:
126159 release :
127160 runs-on : ubuntu-latest
128161 needs : build-java
162+ # Only run release job on master branch
163+ if : github.ref == 'refs/heads/master'
129164 steps :
130165 - name : Checkout code
131166 uses : actions/checkout@v4
@@ -149,34 +184,52 @@ jobs:
149184 - name : Find Main JAR File
150185 id : find_jar
151186 run : |
152- JAR_FILE=$(find target/ -type f -name "xdagj-native-randomx-*.jar" | head -n 1)
187+ JAR_FILE=$(find target/ -type f -name "xdagj-native-randomx-*.jar" ! -name "*-sources.jar" ! -name "*-javadoc.jar" | head -n 1)
153188 if [ -z "$JAR_FILE" ]; then
154189 echo "Error: No main JAR file found!"
155190 exit 1
156191 fi
157192 echo "Found JAR file: $JAR_FILE"
158193 echo "jar_file=$JAR_FILE" >> $GITHUB_ENV
194+ # Also set the JAR filename without path for easier use
195+ JAR_BASENAME=$(basename "$JAR_FILE")
196+ echo "jar_basename=$JAR_BASENAME" >> $GITHUB_ENV
159197
160198 - name : Generate Release Notes
199+ if : github.ref == 'refs/heads/master' # Only on master branch
161200 run : |
162- echo "### Changelog " > RELEASE_NOTES.md
201+ echo "# xdagj-native-randomx v${{ env.VERSION }} " > RELEASE_NOTES.md
163202 echo "" >> RELEASE_NOTES.md
164- echo "$(git log --pretty=format:"* %s (%h)" --no-merges $(git rev-list --tags --max-count=1)..HEAD)" >> RELEASE_NOTES.md
203+ echo "## Changes" >> RELEASE_NOTES.md
204+ echo "- Updated RandomX native libraries" >> RELEASE_NOTES.md
205+ echo "- Improved build process" >> RELEASE_NOTES.md
165206 echo "" >> RELEASE_NOTES.md
166- echo "### Additional Notes" >> RELEASE_NOTES.md
167- echo "- Build improvements." >> RELEASE_NOTES.md
207+ echo "## Native libraries included" >> RELEASE_NOTES.md
208+ echo "- Linux: x86_64" >> RELEASE_NOTES.md
209+ echo "- Windows: x86_64" >> RELEASE_NOTES.md
210+ echo "- macOS: x86_64, aarch64 (Apple Silicon)" >> RELEASE_NOTES.md
211+ echo "" >> RELEASE_NOTES.md
212+ echo "## System requirements" >> RELEASE_NOTES.md
213+ echo "- JDK 17 or later" >> RELEASE_NOTES.md
214+ echo "" >> RELEASE_NOTES.md
215+ echo "## Known issues" >> RELEASE_NOTES.md
168216 echo "- Known issues: None." >> RELEASE_NOTES.md
169217
170218 - name : Create Release using gh CLI
219+ if : github.ref == 'refs/heads/master' # Only on master branch
171220 run : |
172221 gh release create "v${{ env.VERSION }}" --title "xdagj-native-randomx v${{ env.VERSION }}" --notes-file RELEASE_NOTES.md
173222 env :
174223 GH_TOKEN : ${{ github.token }} # Use the token automatically generated by GitHub
175224
176225 - name : Rename output file
177- run : mv "target/xdagj-native-randomx-${{ env.VERSION }}.jar" "target/xdagj-native-randomx.jar"
226+ run : |
227+ echo "Original JAR path: ${{ env.jar_file }}"
228+ cp "${{ env.jar_file }}" "target/xdagj-native-randomx.jar"
229+ echo "✅ Renamed JAR file created at target/xdagj-native-randomx.jar"
178230
179231 - name : Upload JAR using gh CLI
232+ if : github.ref == 'refs/heads/master' # Only on master branch
180233 run : |
181234 gh release upload "v${{ env.VERSION }}" target/xdagj-native-randomx.jar --clobber
182235 env :
0 commit comments