mirror of
https://github.com/VibedByKaKi/llmzip-desktop.git
synced 2026-12-06 19:08:53 +01:00
116 lines
3.2 KiB
YAML
116 lines
3.2 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: release
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: linux-x86_64
|
|
runner: ubuntu-22.04
|
|
shell: bash
|
|
- name: linux-arm64
|
|
runner: ubuntu-22.04-arm
|
|
shell: bash
|
|
- name: macos-arm64
|
|
runner: macos-latest
|
|
shell: bash
|
|
args: --arch arm64 --dmg
|
|
- name: macos-x86_64
|
|
runner: macos-latest
|
|
shell: bash
|
|
args: --arch x86_64 --dmg
|
|
- name: windows-x86_64
|
|
runner: windows-latest
|
|
shell: pwsh
|
|
name: build (${{ matrix.name }})
|
|
runs-on: ${{ matrix.runner }}
|
|
defaults:
|
|
run:
|
|
shell: ${{ matrix.shell }}
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install tinyjs (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-0
|
|
curl -fsSL https://tinyjs.app/install | TINYJS_MODIFY_PATH=1 sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
echo "$HOME/.tinyjs" >> "$GITHUB_PATH"
|
|
|
|
- name: Install tinyjs (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
curl -fsSL https://tinyjs.app/install | TINYJS_MODIFY_PATH=1 sh
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
echo "$HOME/.tinyjs" >> "$GITHUB_PATH"
|
|
|
|
- name: Install tinyjs (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
irm https://tinyjs.app/install.ps1 | iex
|
|
"$env:LOCALAPPDATA\tinyjs" >> $env:GITHUB_PATH
|
|
|
|
- name: Build
|
|
run: tinyjs build ${{ matrix.args }}
|
|
|
|
- name: Package (Linux)
|
|
if: runner.os == 'Linux'
|
|
run: (cd dist && zip -qr "../llmzip-${{ matrix.name }}.zip" .)
|
|
|
|
- name: Package (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
shopt -s nullglob
|
|
for f in dist/*.dmg; do
|
|
cp "$f" "llmzip-${{ matrix.name }}.dmg"
|
|
done
|
|
ls llmzip-${{ matrix.name }}.dmg
|
|
|
|
- name: Package (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: Compress-Archive -Path dist\* -DestinationPath "llmzip-${{ matrix.name }}.zip"
|
|
|
|
- uses: actions/upload-artifact@v5
|
|
with:
|
|
name: llmzip-${{ matrix.name }}
|
|
path: |
|
|
llmzip-${{ matrix.name }}.dmg
|
|
llmzip-${{ matrix.name }}.zip
|
|
if-no-files-found: error
|
|
|
|
release:
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- uses: actions/download-artifact@v5
|
|
with:
|
|
path: assets
|
|
merge-multiple: true
|
|
|
|
- name: Publish prerelease
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
GH_REPO: ${{ github.repository }}
|
|
run: |
|
|
gh release delete latest --cleanup-tag --yes || true
|
|
gh release create latest assets/* \
|
|
--prerelease \
|
|
--target "$GITHUB_SHA" \
|
|
--title "Latest build" \
|
|
--notes "Automatic build of ${GITHUB_SHA::7} from main."
|