Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
# Builds SqlJam. Database servers are not available here: the ci environment runs the integration tests of H2,
# SQLite and DuckDB only, the others are skipped.
#
# check pull requests and master: one Linux build with all tests, the check of merging
# platforms master, tags and manual runs: Windows, macOS and Linux build, start the runnable jar and take
# screenshots, packages for download (src/packaging/package.sh); it does not hold up pull requests
# release tags v*: a GitHub release with the packages of every platform
# check pull requests: one Linux build with all tests, the check of merging
# platforms tags v* and manual runs (Actions > build > Run workflow): Windows, macOS and Linux build, start the
# runnable jar and take screenshots, packages for download (src/packaging/package.sh)
# release tags v*: a GitHub release with the packages of every platform and their SHA-256 checksums
# Merging into master builds nothing, the pull request is checked already.
name: build

on:
push:
branches: [master]
tags: ['v*']
paths-ignore: ['docs/**', '**/*.md', 'change_logs/**']
pull_request:
paths-ignore: ['docs/**', '**/*.md', 'change_logs/**']
workflow_dispatch:
inputs:
version:
description: Version of the packages, e.g. 1.0.0 to try the msi installer (the version of pom.xml if empty)
required: false

# A newer commit of the same branch or pull request cancels the running build
concurrency:
Expand All @@ -23,6 +26,7 @@ concurrency:

jobs:
check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -102,11 +106,25 @@ jobs:
grep -q ":: SqlJam ::" run.log
if grep -E "Exception|ERROR" run.log; then exit 1; fi

# Packages of a tag are named by it (v1.0.0-rc1: SqlJam-1.0.0-rc1-...), others by the version of pom.xml
# jpackage builds the msi installer with the WiX Toolset 3, the binaries are used without installing them
- name: Install the WiX Toolset for the msi installer
if: runner.os == 'Windows'
shell: pwsh
run: |
$wix = Join-Path $env:RUNNER_TEMP "wix"
Invoke-WebRequest -Uri "https://github.com/wixtoolset/wix3/releases/download/wix3141rtm/wix314-binaries.zip" `
-OutFile "$wix.zip"
Expand-Archive -Path "$wix.zip" -DestinationPath $wix
$wix | Out-File -FilePath $env:GITHUB_PATH -Append -Encoding utf8

# Packages of a tag are named by it (v1.0.0-rc1: SqlJam-1.0.0-rc1-...), of a manual run by its version input,
# others by the version of pom.xml. Pre-releases have no msi installer.
- name: Package for download
shell: bash
env:
INPUT_VERSION: ${{ github.event.inputs.version }}
run: |
VERSION=""
VERSION="$INPUT_VERSION"
case "$GITHUB_REF" in refs/tags/v*) VERSION="${GITHUB_REF_NAME#v}" ;; esac
sh src/packaging/package.sh ${{ matrix.platform }} $VERSION

Expand All @@ -131,6 +149,16 @@ jobs:
with:
path: artifacts

# The packages of every platform in one directory with their SHA-256 checksums, verified by downloaders with
# sha256sum -c SHA256SUMS.txt --ignore-missing (shasum -a 256 -c on macOS)
- name: Collect the packages and their checksums
run: |
mkdir release
find artifacts -type f \( -name 'SqlJam-*' -o -name 'sqljam_*.deb' \) -exec cp {} release/ \;
cd release
sha256sum * > SHA256SUMS.txt
cat SHA256SUMS.txt

- name: Create the release with the packages
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -139,4 +167,4 @@ jobs:
PRERELEASE=""
case "$GITHUB_REF_NAME" in *-*) PRERELEASE="--prerelease" ;; esac
gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --title "SqlJam $GITHUB_REF_NAME" \
$PRERELEASE --generate-notes $(find artifacts -name 'SqlJam-*' -o -name 'sqljam_*.deb')
$PRERELEASE --generate-notes release/*
Binary file modified docs/assets/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 8 additions & 2 deletions src/main/java/com/github/sqljam/face/view/LoginView.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,20 @@ public LoginView(AppContext context, Consumer<ConnectionProfile> onLogin) {
}
});
VBox.setVgrow(profileList, Priority.ALWAYS);
Button newButton = new Button(Messages.get("login.new"), Icons.of(Icons.ADD));
// Icons of the list like DBeaver and DataGrip, the names are their tooltips; texts are never cut off
Button newButton = new Button(null, Icons.of(Icons.ADD));
newButton.setId("newButton");
newButton.setTooltip(new Tooltip(Messages.get("login.new")));
newButton.setAccessibleText(Messages.get("login.new"));
newButton.setOnAction(event -> {
profileList.getSelectionModel().clearSelection();
connectionForm.setProfile(new ConnectionProfile(), true);
connectionForm.focusFirstField();
});
Button deleteButton = new Button(Messages.get("login.delete"), Icons.of(Icons.DELETE));
Button deleteButton = new Button(null, Icons.of(Icons.DELETE));
deleteButton.setId("deleteButton");
deleteButton.setTooltip(new Tooltip(Messages.get("login.delete")));
deleteButton.setAccessibleText(Messages.get("login.delete"));
deleteButton.disableProperty().bind(profileList.getSelectionModel().selectedItemProperty().isNull());
deleteButton.setOnAction(event -> deleteSelected());
// The example database comes back after the user removed it
Expand All @@ -111,6 +116,7 @@ public LoginView(AppContext context, Consumer<ConnectionProfile> onLogin) {
.ifPresent(profileList.getSelectionModel()::select);
}));
HBox listButtons = new HBox(8, newButton, deleteButton, exampleButton);
listButtons.getChildren().forEach(button -> ((Button) button).setMinWidth(Region.USE_PREF_SIZE));
Label savedLabel = new Label(Messages.get("login.savedConnections"));
savedLabel.getStyleClass().add("section-title");
VBox left = new VBox(10, savedLabel, searchField, profileList, listButtons);
Expand Down
25 changes: 24 additions & 1 deletion src/packaging/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
# The version names the packages, e.g. 1.0.0-rc1 of the tag v1.0.0-rc1; the version of pom.xml by default.
#
# mac-aarch64, mac SqlJam.app in SqlJam-<version>-<platform>.dmg
# win SqlJam-<version>-win.zip, SqlJam\SqlJam.exe without installing
# win SqlJam-<version>-win.zip, SqlJam\SqlJam.exe without installing, and SqlJam-<version>-win.msi
# of releases (not of pre-releases like 1.0.0-rc1) when the WiX Toolset 3 is on the path
# linux SqlJam-<version>-linux.tar.gz (SqlJam/bin/SqlJam) and sqljam_<version>_amd64.deb
# every platform SqlJam-<version>-<platform>-jar.zip, the runnable jar with its launch scripts (Java 17+)
#
Expand Down Expand Up @@ -103,6 +104,28 @@ case "$PLATFORM" in
win)
rm -f "$OUT/SqlJam-$VERSION-win.zip"
(cd "$WORK" && jar --create --no-manifest --file "$OUT/SqlJam-$VERSION-win.zip" SqlJam)
# An installer with a directory chooser, Start menu and desktop shortcuts. The upgrade code is the same
# for every version, a newer version replaces the installed one. Versions of msi are numbers only, a
# pre-release (1.0.0-rc1, 1.0.0-SNAPSHOT) would be the same version as its release and would not be
# replaced by it, pre-releases have the zip only.
case "$VERSION" in
*-*)
echo "Pre-release $VERSION, the msi installer is skipped" >&2
;;
*)
if command -v candle >/dev/null 2>&1 || command -v candle.exe >/dev/null 2>&1; then
jpackage --type msi --dest "$WORK" --app-image "$WORK/SqlJam" --name SqlJam \
--app-version "$APP_VERSION" --vendor "Fred Feng" \
--description "Import and export tool for relational and OLAP databases" \
--win-dir-chooser --win-menu --win-menu-group SqlJam --win-shortcut \
--win-upgrade-uuid 494b38a3-8f4d-457f-bd03-4b48948608e5
rm -f "$OUT/SqlJam-$VERSION-win.msi"
mv "$WORK"/SqlJam-*.msi "$OUT/SqlJam-$VERSION-win.msi"
else
echo "WiX Toolset 3 not found, the msi installer is skipped" >&2
fi
;;
esac
;;
linux)
rm -f "$OUT/SqlJam-$VERSION-linux.tar.gz"
Expand Down
Loading