Skip to content

fix top-panel ui

fix top-panel ui #4

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: linux-x86_64
- os: macos-latest
target: macos-aarch64
- os: windows-latest
target: windows-x86_64
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Rust
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: release-${{ matrix.os }}
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
zip \
libx11-dev \
libxkbcommon-dev \
libwayland-dev \
libxcb1-dev \
libxrandr-dev \
libxcursor-dev \
libxi-dev \
libxinerama-dev \
libgl1-mesa-dev \
libegl1-mesa-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev
- name: Build
run: cargo build --release
- name: Package (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
VERSION="${{ github.ref_name }}"
ARCHIVE="curve-fit-${VERSION}-${{ matrix.target }}.zip"
rm -f "$ARCHIVE"
if [ -f README.md ]; then
zip -j "$ARCHIVE" target/release/curve-fit README.md
else
zip -j "$ARCHIVE" target/release/curve-fit
fi
- name: Package (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
run: |
$version = "${{ github.ref_name }}"
$archive = "curve-fit-$version-${{ matrix.target }}.zip"
if (Test-Path $archive) { Remove-Item $archive }
$files = @("target/release/curve-fit.exe")
if (Test-Path "README.md") { $files += "README.md" }
Compress-Archive -Path $files -DestinationPath $archive -Force
- name: Package (macOS)
if: matrix.os == 'macos-latest'
run: |
VERSION="${{ github.ref_name }}"
ARCHIVE="curve-fit-${VERSION}-${{ matrix.target }}.zip"
rm -f "$ARCHIVE"
if [ -f README.md ]; then
zip -j "$ARCHIVE" target/release/curve-fit README.md
else
zip -j "$ARCHIVE" target/release/curve-fit
fi
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: curve-fit-${{ github.ref_name }}-${{ matrix.target }}
path: curve-fit-${{ github.ref_name }}-${{ matrix.target }}.zip
release:
name: Publish Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: dist
pattern: curve-fit-*
merge-multiple: true
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ github.token }}
TAG_NAME: ${{ github.ref_name }}
run: |
if gh release view "$TAG_NAME" >/dev/null 2>&1; then
gh release upload "$TAG_NAME" dist/*.zip --clobber
else
gh release create "$TAG_NAME" dist/*.zip --title "$TAG_NAME" --generate-notes
fi