Skip to content

deps: update some packages also use mise (rust 1.81 and node 22) (#316) #412

deps: update some packages also use mise (rust 1.81 and node 22) (#316)

deps: update some packages also use mise (rust 1.81 and node 22) (#316) #412

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
VITE_ENV: "production"
TAURI_DEBUG: "false"
jobs:
create-release-draft:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Create release draft
run: |
echo "Creating release draft for tag: ${{ github.ref_name }}"
gh release create ${{ github.ref_name }} --draft --title "KFtray - ${{ github.ref_name }}" --notes "See the assets to download this version and install."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
kftray-tauri:
needs: create-release-draft
permissions:
contents: write
strategy:
matrix:
include:
- os: ubuntu-latest
arch: arm64
runner: ubicloud-standard-4-arm
rust_target: aarch64-unknown-linux-gnu
tauri_args: "--target aarch64-unknown-linux-gnu --bundles appimage,updater --verbose"
- os: ubuntu-latest
arch: amd64
rust_target: x86_64-unknown-linux-gnu
tauri_args: "--target x86_64-unknown-linux-gnu --bundles appimage,updater --verbose"
- os: macos-latest
arch: universal
rust_target: universal-apple-darwin
tauri_args: "--target universal-apple-darwin --bundles dmg,updater --verbose"
- os: windows-latest
arch: x86
rust_target: i686-pc-windows-msvc
tauri_args: "--target i686-pc-windows-msvc --bundles nsis,updater --verbose"
msvc_arch: x86
- os: windows-latest
arch: x86_64
rust_target: x86_64-pc-windows-msvc
tauri_args: "--target x86_64-pc-windows-msvc --bundles nsis,updater --verbose"
msvc_arch: x64
- os: windows-latest
arch: arm64
rust_target: aarch64-pc-windows-msvc
tauri_args: "--target aarch64-pc-windows-msvc --bundles nsis,updater --verbose"
runs-on: ${{ matrix.runner || matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: swatinem/rust-cache@v2
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: |
- recursive: true
args: [--frozen-lockfile]
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: |
$(pnpm store path --silent)
**/node_modules
key: ${{ runner.OS }}-pnpm-${{ runner.ARCH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.OS }}-pnpm-${{ runner.ARCH }}-
- name: Set up Visual Studio shell
if: matrix.os == 'windows-latest' && matrix.arch == 'arm64'
uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: amd64_arm64
- name: Setup platform-specific dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev
- name: Reconfigure Rust targets
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
rustup target add aarch64-apple-darwin x86_64-apple-darwin
else
rustup target add ${{ matrix.rust_target }}
fi
shell: bash
- name: Build kftray-tauri Desktop App
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_OPTIONS: --max-old-space-size=6000
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
with:
tagName: ${{ github.ref_name }}
releaseName: "KFtray - ${{ github.ref_name }}"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
updaterJsonKeepUniversal: true
args: ${{ matrix.tauri_args }}
kftui:
needs: create-release-draft
permissions:
contents: write
strategy:
matrix:
include:
- os: ubuntu-latest
arch: arm64
runner: ubicloud-standard-4-arm
rust_target: aarch64-unknown-linux-gnu
os_name: linux
- os: ubuntu-latest
arch: amd64
rust_target: x86_64-unknown-linux-gnu
os_name: linux
- os: macos-latest
arch: universal
rust_target: universal-apple-darwin
os_name: macos
- os: windows-latest
arch: x86
rust_target: i686-pc-windows-msvc
msvc_arch: x86
os_name: windows
- os: windows-latest
arch: x86_64
rust_target: x86_64-pc-windows-msvc
msvc_arch: x64
os_name: windows
runs-on: ${{ matrix.runner || matrix.os }}
outputs:
os: ${{ matrix.os }}
arch: ${{ matrix.arch }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust
uses: swatinem/rust-cache@v2
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: |
- recursive: true
args: [--frozen-lockfile]
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "pnpm"
- name: Cache pnpm modules
uses: actions/cache@v4
with:
path: |
$(pnpm store path --silent)
**/node_modules
key: ${{ runner.OS }}-pnpm-${{ runner.ARCH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.OS }}-pnpm-${{ runner.ARCH }}-
- name: Setup platform-specific dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev libssl-dev
- name: Reconfigure Rust targets
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
rustup target add aarch64-apple-darwin x86_64-apple-darwin
else
rustup target add ${{ matrix.rust_target }}
fi
shell: bash
- name: Install OpenSSL on Windows
if: matrix.os == 'windows-latest'
run: choco install openssl
- name: Set up Perl on Windows
if: matrix.os == 'windows-latest'
uses: shogo82148/actions-setup-perl@v1
with:
perl-version: "5.32"
distribution: "strawberry"
- name: Set Perl environment variables
if: matrix.os == 'windows-latest'
run: |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Build kftui
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
cargo build --release --bin kftui --target aarch64-apple-darwin
cargo build --release --bin kftui --target x86_64-apple-darwin
lipo -create -output ./target/release/kftui ./target/x86_64-apple-darwin/release/kftui ./target/aarch64-apple-darwin/release/kftui
else
cargo build --release --bin kftui --target ${{ matrix.rust_target }}
fi
shell: bash
- name: Sign and notarize the release build
if: matrix.os == 'macos-latest'
uses: toitlang/[email protected]
with:
certificate: ${{ secrets.APPLE_CERTIFICATE }}
certificate-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
username: ${{ secrets.APPLE_ID }}
password: ${{ secrets.APPLE_PASSWORD }}
apple-team-id: 6M376JWU73
app-path: target/release/kftui
entitlements-path: crates/kftui/entitlements.plist
- name: Rename and upload release asset
run: |
if [ "${{ matrix.os }}" == "macos-latest" ]; then
mv ./target/release/kftui ./target/release/kftui_macos_universal
gh release upload ${{ github.ref_name }} ./target/release/kftui_macos_universal --clobber
elif [ "${{ matrix.os }}" == "windows-latest" ]; then
mv ./target/${{ matrix.rust_target }}/release/kftui.exe ./target/release/kftui_${{ matrix.os_name }}_${{ matrix.arch }}.exe
chmod +x ./target/release/kftui_${{ matrix.os_name }}_${{ matrix.arch }}.exe
gh release upload ${{ github.ref_name }} ./target/release/kftui_${{ matrix.os_name }}_${{ matrix.arch }}.exe
else
mv ./target/${{ matrix.rust_target }}/release/kftui ./target/release/kftui_${{ matrix.os_name }}_${{ matrix.arch }}
chmod +x ./target/release/kftui_${{ matrix.os_name }}_${{ matrix.arch }}
gh release upload ${{ github.ref_name }} ./target/release/kftui_${{ matrix.os_name }}_${{ matrix.arch }}
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
shell: bash
kftray-server:
permissions:
contents: write
packages: write
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: ./crates/kftray-server
file: ./crates/kftray-server/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/kftray-server:${{ github.sha }}
ghcr.io/${{ github.repository_owner }}/kftray-server:${{ github.ref_name }}
ghcr.io/${{ github.repository_owner }}/kftray-server:latest