Skip to content

fix: expose bundled JVM libraries to AppImage bundler #10

fix: expose bundled JVM libraries to AppImage bundler

fix: expose bundled JVM libraries to AppImage bundler #10

Workflow file for this run

name: Package
on:
push:
branches: [main]
workflow_dispatch:
inputs:
publish_authorized_artifact:
description: Sign and notarize macOS packages with the configured Apple credentials
required: false
type: boolean
default: false
permissions:
contents: read
concurrency:
group: package-${{ github.ref }}
cancel-in-progress: false
jobs:
macos:
name: macOS ${{ matrix.artifact_name }} package
strategy:
fail-fast: false
matrix:
include:
- os: macos-15
arch: arm64
artifact_name: macos-arm64
- os: macos-15-intel
arch: x86_64
artifact_name: macos-x64
runs-on: ${{ matrix.os }}
timeout-minutes: 150
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Verify runner architecture
run: test "$(uname -m)" = "${{ matrix.arch }}"
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c
with:
toolchain: 1.88.0
components: clippy
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1
with:
shared-key: package-${{ matrix.artifact_name }}
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.7.1
with:
distribution: temurin
java-version: "17"
cache: maven
cache-dependency-path: |
java/pom.xml
java/compat-runtime/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-bom/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-spi/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-api/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-h2/pom.xml
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "22.22.2"
cache: npm
cache-dependency-path: apps/frontend/package-lock.json
- name: Install pinned Tauri CLI
run: cargo install tauri-cli --version 2.8.4 --locked
- name: Configure Developer ID signing and notarization
if: ${{ inputs.publish_authorized_artifact == true }}
env:
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
MAC_CERTS: ${{ secrets.MAC_CERTS }}
MAC_CERTS_PASSWORD: ${{ secrets.MAC_CERTS_PASSWORD }}
run: ./scripts/configure-macos-signing.sh
- name: Build and verify macOS package
run: make macos-package
- name: Remove ephemeral signing keychain
if: ${{ always() }}
run: ./scripts/cleanup-macos-signing.sh
- name: Add package manifest to summary
run: cat target/macos-package/BUILD-MANIFEST.txt >> "$GITHUB_STEP_SUMMARY"
- name: Upload macOS package
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Chat2DB-Rust-${{ matrix.artifact_name }}-${{ github.sha }}
path: |
target/macos-package/*.zip
target/macos-package/*.dmg
target/macos-package/SHA256SUMS
target/macos-package/BUILD-MANIFEST.txt
if-no-files-found: error
compression-level: 0
retention-days: 7
windows:
name: Windows x86_64 NSIS and MSI package
runs-on: windows-latest
timeout-minutes: 150
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2
with:
fetch-depth: 0
- name: Configure Windows checkout
shell: pwsh
run: |
git config --global core.longpaths true
git config --global core.autocrlf false
git submodule update --init --recursive
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c
with:
toolchain: 1.88.0
components: clippy
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1
with:
shared-key: package-windows-x86_64
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.7.1
with:
distribution: temurin
java-version: "17"
cache: maven
cache-dependency-path: |
java/pom.xml
java/compat-runtime/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-bom/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-spi/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-api/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-h2/pom.xml
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "22.22.2"
cache: npm
cache-dependency-path: apps/frontend/package-lock.json
- name: Install pinned Tauri CLI
shell: pwsh
run: cargo install tauri-cli --version 2.8.4 --locked
- name: Package Java compatibility engine
working-directory: java
shell: pwsh
run: .\mvnw.cmd -B -DskipTests package
- name: Build fixed Community H2 compatibility classpath
shell: bash
run: ./scripts/build-community-h2-classpath.sh
- name: Build frontend
working-directory: apps/frontend
shell: pwsh
run: npm ci; npm run typecheck; npm test; npm run build
- name: Build Windows Java runtime
shell: pwsh
run: ./scripts/build-windows-runtime.ps1
- name: Prepare Windows driver packs
shell: bash
run: |
rm -rf target/windows-driver-packs
./scripts/prepare-mysql-driver-pack.sh target/windows-driver-packs
./scripts/prepare-h2-driver-pack.sh target/windows-driver-packs
- name: Build and verify Windows installers
shell: bash
run: ./scripts/build-windows-package.sh
- name: Add package manifest to summary
shell: pwsh
run: Get-Content target/windows-package/BUILD-MANIFEST.txt | Out-File -FilePath $env:GITHUB_STEP_SUMMARY -Append
- name: Upload Windows installers
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Chat2DB-Rust-windows-x86_64-${{ github.sha }}
path: |
target/windows-package/*.exe
target/windows-package/*.msi
target/windows-package/SHA256SUMS
target/windows-package/BUILD-MANIFEST.txt
if-no-files-found: error
compression-level: 0
retention-days: 7
linux:
name: Linux ${{ matrix.artifact_name }} packages
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
arch: x86_64
artifact_name: linux-x86_64
- os: ubuntu-22.04-arm
arch: aarch64
artifact_name: linux-arm64
runs-on: ${{ matrix.os }}
timeout-minutes: 150
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.2.2
with:
fetch-depth: 0
submodules: recursive
- name: Install Linux packaging dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
fakeroot file libappindicator3-dev libsecret-1-dev xdg-utils \
libwebkit2gtk-4.1-dev librsvg2-dev patchelf rpm
- name: Verify runner architecture
run: test "$(uname -m)" = "${{ matrix.arch }}"
- uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c
with:
toolchain: 1.88.0
components: clippy
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2.8.1
with:
shared-key: package-${{ matrix.artifact_name }}
- uses: actions/setup-java@c1e323688fd81a25caa38c78aa6df2d33d3e20d9 # v4.7.1
with:
distribution: temurin
java-version: "17"
cache: maven
cache-dependency-path: |
java/pom.xml
java/compat-runtime/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-bom/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-spi/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-api/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-mysql/pom.xml
third_party/chat2db-community/chat2db-community-server/chat2db-community-plugins/chat2db-community-h2/pom.xml
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: "22.22.2"
cache: npm
cache-dependency-path: apps/frontend/package-lock.json
- name: Install pinned Tauri CLI
run: cargo install tauri-cli --version 2.8.4 --locked
- name: Package Java compatibility engine
working-directory: java
run: ./mvnw -B -DskipTests package
- name: Build fixed Community H2 compatibility classpath
run: ./scripts/build-community-h2-classpath.sh
- name: Build frontend
working-directory: apps/frontend
run: npm ci && npm run typecheck && npm test && npm run build
- name: Build Linux Java runtime
run: ./scripts/build-linux-runtime.sh
- name: Prepare Linux driver packs
run: ./scripts/prepare-linux-driver-packs.sh
- name: Build and verify Linux packages
run: ./scripts/build-linux-package.sh
- name: Add package manifest to summary
run: cat target/linux-package/BUILD-MANIFEST.txt >> "$GITHUB_STEP_SUMMARY"
- name: Upload Linux packages
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: Chat2DB-Rust-${{ matrix.artifact_name }}-${{ github.sha }}
path: |
target/linux-package/*.AppImage
target/linux-package/*.deb
target/linux-package/*.rpm
target/linux-package/SHA256SUMS
target/linux-package/BUILD-MANIFEST.txt
if-no-files-found: error
compression-level: 0
retention-days: 7
notify-feishu:
name: Notify Feishu
if: ${{ always() }}
needs: [macos, windows, linux]
runs-on: ubuntu-latest
steps:
- name: Send package result to Feishu
env:
FEISHU_WEBHOOK_URL: ${{ secrets.FEISHU_WEBHOOK_URL }}
MACOS_RESULT: ${{ needs.macos.result }}
WINDOWS_RESULT: ${{ needs.windows.result }}
LINUX_RESULT: ${{ needs.linux.result }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
COMMIT_SHA: ${{ github.sha }}
run: |
if [[ -z "${FEISHU_WEBHOOK_URL}" ]]; then
echo "FEISHU_WEBHOOK_URL is not configured; skipping notification"
exit 0
fi
message="$(printf 'Chat2DB Rust Package\nWorkflow: %s\nCommit: %s\nmacOS: %s\nWindows: %s\nLinux: %s\n%s' \
"${GITHUB_WORKFLOW}" "${COMMIT_SHA}" "${MACOS_RESULT}" "${WINDOWS_RESULT}" "${LINUX_RESULT}" "${RUN_URL}")"
payload="$(jq -n --arg text "${message}" '{msg_type: "text", content: {text: $text}}')"
curl --fail-with-body --silent --show-error --retry 3 \
--header 'Content-Type: application/json' \
--data "${payload}" \
"${FEISHU_WEBHOOK_URL}"