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
11 changes: 9 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,13 @@ 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
- name: Package for download
shell: bash
run: sh src/packaging/package.sh ${{ matrix.platform }}
run: |
VERSION=""
case "$GITHUB_REF" in refs/tags/v*) VERSION="${GITHUB_REF_NAME#v}" ;; esac
sh src/packaging/package.sh ${{ matrix.platform }} $VERSION

- uses: actions/upload-artifact@v4
if: always()
Expand All @@ -130,6 +134,9 @@ jobs:
- name: Create the release with the packages
env:
GH_TOKEN: ${{ github.token }}
# A tag with a suffix, e.g. v1.0.0-rc1 or v1.0.0-beta, is a pre-release, it is not the latest release
run: |
PRERELEASE=""
case "$GITHUB_REF_NAME" in *-*) PRERELEASE="--prerelease" ;; esac
gh release create "$GITHUB_REF_NAME" --repo "$GITHUB_REPOSITORY" --title "SqlJam $GITHUB_REF_NAME" \
--generate-notes $(find artifacts -name 'SqlJam-*' -o -name 'sqljam_*.deb')
$PRERELEASE --generate-notes $(find artifacts -name 'SqlJam-*' -o -name 'sqljam_*.deb')
8 changes: 6 additions & 2 deletions src/packaging/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#
# sh src/packaging/package.sh <platform> [version] platform: mac-aarch64, mac, win or linux
#
# 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
# linux SqlJam-<version>-linux.tar.gz (SqlJam/bin/SqlJam) and sqljam_<version>_amd64.deb
Expand All @@ -18,8 +20,10 @@ set -e

PLATFORM=${1:?platform: mac-aarch64, mac, win or linux}
DIR=$(cd "$(dirname "$0")/../.." && pwd)
VERSION=${2:-$(sed -n 's:^ <version>\(.*\)</version>:\1:p' "$DIR/pom.xml" | head -1)}
JAR="sqljam-$VERSION-$PLATFORM.jar"
# The runnable jar is named by the version of pom.xml, the packages by the given version
POM_VERSION=$(sed -n 's:^ <version>\(.*\)</version>:\1:p' "$DIR/pom.xml" | head -1)
VERSION=${2:-$POM_VERSION}
JAR="sqljam-$POM_VERSION-$PLATFORM.jar"
# jpackage takes numbers only, e.g. 1.0.0 of 1.0.0-SNAPSHOT
APP_VERSION=$(echo "$VERSION" | sed 's/[^0-9.].*$//')
WORK="$DIR/target/package-$PLATFORM"
Expand Down
Loading