mirror of
https://github.com/runelite/plugin-hub.git
synced 2026-05-18 13:38:41 -04:00
package: upload output jars as build artifacts
This commit is contained in:
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@@ -73,6 +73,12 @@ jobs:
|
||||
name: manifest_diff
|
||||
path: /tmp/manifest_diff
|
||||
retention-days: 1
|
||||
- uses: actions/upload-artifact@v3
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
with:
|
||||
name: jars
|
||||
path: /tmp/jars
|
||||
retention-days: 1
|
||||
upload:
|
||||
if: (github.event_name != 'push' || github.repository_owner == 'runelite') && github.event_name != 'pull_request'
|
||||
needs: build
|
||||
|
||||
@@ -64,6 +64,7 @@ public class Packager implements Closeable
|
||||
{
|
||||
private static final File PLUGIN_ROOT = new File("./plugins");
|
||||
public static final File PACKAGE_ROOT = new File("./package/").getAbsoluteFile();
|
||||
private static final File ARTIFACT_DIR = new File("/tmp/jars");
|
||||
|
||||
private Semaphore apiCheckSemaphore = new Semaphore(8);
|
||||
private Semaphore downloadSemaphore = new Semaphore(2);
|
||||
@@ -108,6 +109,8 @@ public class Packager implements Closeable
|
||||
diff.setOldManifestVersion(apiFilesVersion);
|
||||
}
|
||||
|
||||
ARTIFACT_DIR.mkdirs();
|
||||
|
||||
Queue<File> buildQueue = Queues.synchronizedQueue(new ArrayDeque<>(buildList));
|
||||
List<Thread> buildThreads = IntStream.range(0, 8)
|
||||
.mapToObj(v ->
|
||||
@@ -191,6 +194,8 @@ public class Packager implements Closeable
|
||||
logURL = p.uploadLog(uploadConfig);
|
||||
}
|
||||
|
||||
p.copyArtifacts(ARTIFACT_DIR);
|
||||
|
||||
diff.getAdd().add(p.getManifest());
|
||||
log.info("{}: done in {}ms [{}/{}]", p.getInternalName(), p.getBuildTimeMS(), numDone.get() + 1, numTotal);
|
||||
|
||||
|
||||
@@ -944,6 +944,12 @@ public class Plugin implements Closeable
|
||||
return url.toString();
|
||||
}
|
||||
|
||||
public void copyArtifacts(File artifactDir) throws IOException
|
||||
{
|
||||
Files.copy(jarFile.toPath(), new File(artifactDir, getInternalName() + ".jar").toPath());
|
||||
Files.copy(logFile.toPath(), new File(artifactDir, getInternalName() + ".log").toPath());
|
||||
}
|
||||
|
||||
public void writeLog(String format, Object... args) throws IOException
|
||||
{
|
||||
FormattingTuple fmt = MessageFormatter.arrayFormat(format, args);
|
||||
|
||||
Reference in New Issue
Block a user