Skip to content

Commit 27dddd0

Browse files
feat: github action to attach binary to release [macata #33] (#34)
1 parent f08b7f1 commit 27dddd0

File tree

6 files changed

+60
-5
lines changed

6 files changed

+60
-5
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Attach binary to release
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
tag_and_release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Set up JDK 18
14+
uses: actions/setup-java@v3
15+
with:
16+
java-version: '18'
17+
distribution: 'adopt'
18+
cache: maven
19+
20+
- name: Cache local Maven repository
21+
uses: actions/cache@v3
22+
with:
23+
path: ~/.m2/repository
24+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
25+
restore-keys: |
26+
${{ runner.os }}-maven-
27+
28+
- name: Build with Maven
29+
run: mvn package
30+
31+
- name: Extract Version from POM
32+
id: extract_version
33+
run: echo ::set-output name=version::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
34+
35+
- name: Upload Release Asset
36+
id: upload-release-asset
37+
uses: actions/upload-release-asset@v1
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
with:
41+
upload_url: ${{ github.event.release.upload_url }}
42+
asset_path: ./target/macatalauncher-${{ steps.extract_version.outputs.version }}.jar
43+
asset_name: macatalauncher-${{ steps.extract_version.outputs.version }}.jar
44+
asset_content_type: application/java-archive

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Java Build & Test
1+
name: Java build & test
22

33
on: [push]
44

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CodeQL Analysis
1+
name: CodeQL analysis
22

33
on:
44
push:
File renamed without changes.

src/main/java/com/dazednconfused/catalauncher/gui/ConfirmDialog.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ public class ConfirmDialog extends JDialog {
3333
private JLabel dialogMessage;
3434
private JSVGCanvas iconSvg;
3535

36+
/**
37+
* Same as {@link #ConfirmDialog(String, ConfirmDialogType, Consumer)}, with the following defaults:
38+
* <ul>
39+
* <li>{@code dialogType} is {@link ConfirmDialogType#NONE}.</li>
40+
* <li>{@code doOnResult} is {@link #DO_NOTHING_ACTION}.</li>
41+
* </ul>
42+
*
43+
* @param message The message to show in the dialog.
44+
* */
45+
public ConfirmDialog(String message) {
46+
this(message, ConfirmDialogType.NONE, DO_NOTHING_ACTION);
47+
}
48+
3649
/**
3750
* Shows a confirmation dialog, which is basically a {@link JDialog} composed of a {@link String} {@code message}, a {@link ConfirmDialogType}
3851
* which gives visual feedback of the severity of the message by means of different icons, and a {@link Consumer} action

src/main/java/com/dazednconfused/catalauncher/gui/VersionManagerWindow.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ public static void checkForUpdates(JPanel parent, boolean showDialogIfNoUpdateAv
106106
}
107107

108108
ConfirmDialog confirmDialog = new ConfirmDialog(
109-
"There were no updates found",
110-
ConfirmDialog.ConfirmDialogType.NONE,
111-
ConfirmDialog.DO_NOTHING_ACTION
109+
"There were no updates found"
112110
);
113111

114112
confirmDialog.packCenterAndShow(parent);

0 commit comments

Comments
 (0)