Fix Windows run and merge tag+jar into version input
This commit is contained in:
parent
f25fbbb80e
commit
ea8307908b
2 changed files with 32 additions and 14 deletions
27
action.yml
27
action.yml
|
@ -8,32 +8,31 @@ branding:
|
||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
|
|
||||||
tag:
|
version:
|
||||||
description: 'The GitHub releases tag that points to JReleaser''s executable JAR file.'
|
description: 'The version of JReleaser to download and execute.'
|
||||||
default: 'early-access'
|
default: 'early-access'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jar:
|
|
||||||
description: 'The name of the executable JAR file to download and execute.'
|
|
||||||
default: 'jreleaser-tool-provider-0.1.0-SNAPSHOT.jar'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
arguments:
|
arguments:
|
||||||
description: 'The arguments to be passed to JReleaser.'
|
description: 'The command-line arguments to be passed to JReleaser.'
|
||||||
default: 'full-release'
|
default: 'full-release'
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: 'Initialize JReleaser'
|
- name: 'Download JReleaser'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Initialize JReleaser"
|
echo "::group::Download JReleaser"
|
||||||
wget https://github.com/jreleaser/jreleaser/releases/download/${{ inputs.tag }}/${{ inputs.jar }}
|
JAR="jreleaser-tool-provider-${{ inputs.version }}.jar"
|
||||||
|
URL="https://github.com/jreleaser/jreleaser/releases/download/${{ inputs.version }}/$JAR"
|
||||||
|
java ${{ github.action_path }}/copy.java $URL $JAR
|
||||||
|
java -jar $JAR --version
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
- name: 'Launch JReleaser'
|
- name: 'Execute JReleaser'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "java -jar ${{ inputs.jar }} ${{ inputs.arguments }}"
|
JAR="jreleaser-tool-provider-${{ inputs.version }}.jar"
|
||||||
java -jar ${{ inputs.jar }} ${{ inputs.arguments }}
|
echo "java -jar $JAR ${{ inputs.arguments }}"
|
||||||
|
java -jar $JAR ${{ inputs.arguments }}
|
||||||
|
|
19
copy.java
Normal file
19
copy.java
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import java.net.URL;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.StandardCopyOption;
|
||||||
|
|
||||||
|
class copy {
|
||||||
|
public static void main(String... args) throws Exception {
|
||||||
|
if (args.length != 2) {
|
||||||
|
System.err.println("Usage: java copy.java URL FILENAME");
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
var url = args[0];
|
||||||
|
try (var stream = new URL(url).openStream()) {
|
||||||
|
var file = Path.of(args[1]);
|
||||||
|
var size = Files.copy(stream, file, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
System.out.printf("%s << copied %d bytes << %s%n", file, size, url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue