94 lines
3.9 KiB
YAML
94 lines
3.9 KiB
YAML
name: tauri-build-linux-x64-external
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
ref:
|
|
required: true
|
|
type: string
|
|
default: 'refs/heads/main'
|
|
new_version:
|
|
required: true
|
|
type: string
|
|
default: ''
|
|
channel:
|
|
required: true
|
|
type: string
|
|
default: 'nightly'
|
|
description: 'The channel to use for this job'
|
|
disable_updater:
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
description: 'If true, builds both .deb and .appimage but disables auto-updater'
|
|
jobs:
|
|
build-linux-x64-external:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Getting the repo
|
|
uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ inputs.ref }}
|
|
|
|
- name: Free Disk Space Before Build
|
|
run: |
|
|
echo "Disk space before cleanup:"
|
|
df -h
|
|
sudo rm -rf /usr/local/.ghcup
|
|
sudo rm -rf /opt/hostedtoolcache/CodeQL
|
|
sudo rm -rf /usr/local/lib/android/sdk/ndk
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf /usr/local/share/boost
|
|
sudo apt-get clean
|
|
echo "Disk space after cleanup:"
|
|
df -h
|
|
- name: Replace Icons for Beta Build
|
|
if: inputs.channel != 'stable'
|
|
shell: bash
|
|
run: |
|
|
cp .github/scripts/icon-${{ inputs.channel }}.png src-tauri/icons/icon.png
|
|
- name: Installing node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 20
|
|
|
|
- name: Install jq
|
|
uses: dcarbone/install-jq-action@v2.0.1
|
|
|
|
- name: Install ctoml
|
|
run: |
|
|
cargo install ctoml
|
|
- name: Install Tauri dependencies
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev libfuse2
|
|
- name: Update app version
|
|
run: |
|
|
echo "Version: ${{ inputs.new_version }}"
|
|
jq --arg version "${{ inputs.new_version }}" '.version = $version | .bundle.createUpdaterArtifacts = false' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
|
jq '.bundle.linux.deb.files = {"usr/bin/bun": "resources/bin/bun",
|
|
"usr/lib/Jan-${{ inputs.channel }}/resources/lib/libvulkan.so": "resources/lib/libvulkan.so"}' ./src-tauri/tauri.linux.conf.json > /tmp/tauri.linux.conf.json
|
|
mv /tmp/tauri.linux.conf.json ./src-tauri/tauri.linux.conf.json
|
|
fi
|
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web-app/package.json > /tmp/package.json
|
|
mv /tmp/package.json web-app/package.json
|
|
ctoml ./src-tauri/Cargo.toml dependencies.tauri.features[] "devtools"
|
|
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
|
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
|
jq '.plugins.updater.endpoints = ["https://delta.jan.ai/${{ inputs.channel }}/latest.json"]' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
|
chmod +x .github/scripts/rename-tauri-app.sh
|
|
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json ${{ inputs.channel }}
|
|
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
|
|
ctoml ./src-tauri/Cargo.toml dependencies.tauri.features[] "devtools"
|
|
chmod +x .github/scripts/rename-workspace.sh
|
|
.github/scripts/rename-workspace.sh ./package.json ${{ inputs.channel }}
|
|
fi
|
|
- name: Build app
|
|
run: |
|
|
make build
|
|
env:
|
|
RELEASE_CHANNEL: '${{ inputs.channel }}'
|
|
AUTO_UPDATER_DISABLED: ${{ inputs.disable_updater && 'true' || 'false' }} |