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
39 changes: 32 additions & 7 deletions .github/workflows/github_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,38 @@ calculate_checksum "$sbom_path"
readonly sbom_checksum_path="${sbom_path}.sha256"

shopt -s nullglob
native_assets=()
native_release_assets=()
for native_asset in "$base_dir"/native-image/target/openfasttrace-*; do
[[ ${native_asset##*/} =~ ^openfasttrace-(linux|windows|macos)([-._].*)?$ ]] &&
native_assets+=("$native_asset")
calculate_checksum "$native_asset"
native_release_assets+=("$native_asset" "${native_asset}.sha256")
package_native_binary() {
local native_binary="$1"
local temporary_directory
local package_path
temporary_directory=$(mktemp -d)
readonly temporary_directory
cp "$native_binary" "$temporary_directory/oft"

case "${native_binary##*/}" in
openfasttrace-windows*)
package_path="${native_binary%.exe}.zip"
(cd "$temporary_directory" && zip --quiet "$package_path" oft)
;;
openfasttrace-linux* | openfasttrace-macos*)
package_path="${native_binary}.tar.gz"
tar --create --gzip --file "$package_path" --directory "$temporary_directory" oft
;;
*)
rm -rf "$temporary_directory"
return 1
;;
esac

rm -rf "$temporary_directory"
calculate_checksum "$package_path"
native_release_assets+=("$package_path" "${package_path}.sha256")
}

for native_binary in "$base_dir"/native-image/target/openfasttrace-*; do
[[ ${native_binary##*/} =~ ^openfasttrace-(linux|windows|macos)([-._].*)?$ ]] || continue
package_native_binary "$native_binary"
done

# Create GitHub release
Expand All @@ -56,7 +81,7 @@ echo "Artifact file : $artifact_path"
echo "Artifact checksum: $artifact_checksum_path"
echo "SBOM file : $sbom_path"
echo "SBOM checksum : $sbom_checksum_path"
printf 'Platform binaries: %s\n' "${native_assets[@]}"
printf 'Platform binary packages: %s\n' "${native_release_assets[@]}"

release_url=$(gh release create --latest --title "$title" --notes "$notes" --target main "$tag" \
"$artifact_path" "$artifact_checksum_path" "$sbom_path" "$sbom_checksum_path" \
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ jobs:
MAVEN_GPG_PASSPHRASE: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}

- name: Create GitHub Release
# [bld->dsn~cli.native-executable.release-packaging~1]
run: ./.github/workflows/github_release.sh
env:
GH_TOKEN: ${{ github.token }}
3 changes: 2 additions & 1 deletion doc/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ nav_order: 9

# Changes

* [4.12.0](changes_4.12.0.md) unreleased
* [4.12.1](changes_4.12.1.md) unreleased
* [4.12.0](changes_4.12.0.md)
* [4.11.0](changes_4.11.0.md)
* [4.10.0](changes_4.10.0.md)
* [4.9.0](changes_4.9.0.md)
Expand Down
12 changes: 12 additions & 0 deletions doc/changes/changes_4.12.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OpenFastTrace 4.12.1, Unreleased on GitHub

Code name: Compressed Native Release Packages

## Summary

Native command-line executables in GitHub releases are now compressed for faster downloads and reduced storage use. Linux and macOS packages use `.tar.gz`; the Windows package uses `.zip`.
Each package contains the executable named `oft` and has a SHA-256 checksum for the compressed package.

## Features

* #656: Compress native binaries in GitHub releases
12 changes: 12 additions & 0 deletions doc/spec/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -1513,6 +1513,18 @@ Covers:

Needs: itest, bld

#### Native Binary Release Packages
`dsn~cli.native-executable.release-packaging~1`

The GitHub release workflow creates compressed archives containing the native executable called `oft`.
Archives are `.tar.gz` for Linux and macOS or a `.zip` package for Windows. The workflow calculates the SHA-256 checksum of each compressed package.

Covers:

* [`req~cli.native-executable.release-packaging~1`](system_requirements.md#native-command-line-executable-release-packages)

Needs: bld

# Quality Requirements

See [Quality Requirements](design/quality_requirements.md).
Expand Down
13 changes: 13 additions & 0 deletions doc/spec/system_requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,19 @@ Covers:

Needs: dsn

#### Native Command Line Executable Release Packages
`req~cli.native-executable.release-packaging~1`

OpenFastTrace distributes native command line executables as GitHub release packages.
Linux and macOS packages use the `.tar.gz` format, Windows packages use the `.zip` format, and every package contains the executable named `oft`.
Each package has a SHA-256 checksum file calculated from the compressed package.

Covers:

* [feat~command-line-interface~1](#command-line-interface)

Needs: dsn

### Third Party Plugins

#### Loading Plugins
Expand Down
7 changes: 4 additions & 3 deletions doc/user_guide/installation/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ There are several ways to install OpenFastTrace on Linux, depending on your dist

### Native Executable

Download `openfasttrace-linux-x64` or `openfasttrace-linux-arm64` from the [GitHub Releases](https://github.com/itsallcode/openfasttrace/releases) page. The native executable does not require Java. Make it executable and run it:
Download `openfasttrace-linux-x64.tar.gz` or `openfasttrace-linux-arm64.tar.gz` from the [GitHub Releases](https://github.com/itsallcode/openfasttrace/releases) page. Extract the archive, make the included `oft` executable runnable, and start it. The native executable does not require Java:

```bash
chmod +x openfasttrace-linux-x64
./openfasttrace-linux-x64 --help
tar -xzf openfasttrace-linux-x64.tar.gz
chmod +x oft
./oft --help
```

Use the executable JAR below when you need third-party Java plugin JARs.
Expand Down
7 changes: 4 additions & 3 deletions doc/user_guide/installation/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ OpenFastTrace can be installed on macOS using Homebrew, JBang or manually via a

### Native Executable

Download the matching executable, `openfasttrace-macos-arm64` for Apple Silicon from the [GitHub Releases](https://github.com/itsallcode/openfasttrace/releases) page. The native executable does not require Java. Run it from Terminal:
Download `openfasttrace-macos-arm64.tar.gz` for Apple Silicon from the [GitHub Releases](https://github.com/itsallcode/openfasttrace/releases) page. Extract the archive and run the included `oft` executable from Terminal. The native executable does not require Java:

```bash
chmod +x openfasttrace-macos-arm64
./openfasttrace-macos-arm64 --help
tar -xzf openfasttrace-macos-arm64.tar.gz
chmod +x oft
./oft --help
```

Use the executable JAR below when you need third-party Java plugin JARs.
Expand Down
5 changes: 3 additions & 2 deletions doc/user_guide/installation/windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ On Windows, OpenFastTrace can be run via JBang or manually via the JAR file.

### Native Executable

Download `openfasttrace-windows-x64.exe` from the [GitHub Releases](https://github.com/itsallcode/openfasttrace/releases) page and run it from PowerShell:
Download `openfasttrace-windows-x64.zip` from the [GitHub Releases](https://github.com/itsallcode/openfasttrace/releases) page. Extract it and run the included `oft` executable from PowerShell:

```powershell
.\openfasttrace-windows-x64.exe --help
Expand-Archive openfasttrace-windows-x64.zip -DestinationPath oft
.\oft\oft --help
```

The native executable does not require Java. Use the executable JAR below when you need third-party Java plugin JARs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ private ImportSettings buildOftSettings()
final Path baseDir = getProjectBaseDir();
return ImportSettings.builder()
.addInputs(baseDir.resolve("doc/spec/"))
.addInputs(baseDir.resolve(".github/workflows/"))
.addInputs(baseDir.resolve("product/pom.xml"))
.addInputs(baseDir.resolve("native-image/pom.xml"))
.addInputs(findInputDirectories(baseDir))
Expand Down
Loading