mirror of
https://github.com/librekeys/picoforge.git
synced 2026-07-28 08:01:19 -07:00
105 lines
3.5 KiB
YAML
105 lines
3.5 KiB
YAML
name: "publish-stable"
|
|
on:
|
|
push:
|
|
branches:
|
|
- release-nightly
|
|
|
|
jobs:
|
|
publish-tauri:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- platform: "macos-latest"
|
|
args: "--target aarch64-apple-darwin"
|
|
- platform: "macos-latest"
|
|
args: "--target x86_64-apple-darwin"
|
|
- platform: "ubuntu-22.04"
|
|
args: ""
|
|
- platform: "windows-latest"
|
|
args: "--target x86_64-pc-windows-msvc"
|
|
- platform: "windows-latest"
|
|
args: "--target i686-pc-windows-msvc"
|
|
- platform: "windows-latest"
|
|
args: "--target aarch64-pc-windows-msvc"
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: setup node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: lts/*
|
|
|
|
- name: install Rust stable
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: >
|
|
${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' ||
|
|
matrix.platform == 'windows-latest' && 'x86_64-pc-windows-msvc,i686-pc-windows-msvc,aarch64-pc-windows-msvc' || '' }}
|
|
|
|
- name: install dependencies (ubuntu only)
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libpcsclite-dev libudev-dev libusb-1.0-0-dev
|
|
# --- ADDED: Prerequisites for repacking AppImage ---
|
|
sudo apt-get install -y fuse libfuse2
|
|
|
|
- name: Setup Deno
|
|
uses: denoland/setup-deno@v2
|
|
with:
|
|
deno-version: v2.x
|
|
|
|
- name: install frontend dependencies
|
|
run: deno install
|
|
|
|
- name: Extract version from Cargo.toml
|
|
id: get_version
|
|
shell: bash
|
|
run: |
|
|
cargo_file="src-tauri/Cargo.toml"
|
|
version=$(grep -m 1 '^version' "$cargo_file" | sed -E 's/.*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/')
|
|
echo "version=$version" >> $GITHUB_ENV
|
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tagName: v${{ env.version }}
|
|
releaseName: "PicoForge(v${{ env.version }})-nightly"
|
|
releaseBody: |
|
|
### PicoForge app(v${{ env.version }}) Nightly release
|
|
|
|
> [!CAUTION]
|
|
> This is a nightly release and thus will have bugs.
|
|
>
|
|
> I am not responsible if using this build bricks your pico in any way.
|
|
releaseDraft: true
|
|
prerelease: false
|
|
args: ${{ matrix.args }}
|
|
|
|
- name: Patch and Overwrite AppImage
|
|
if: matrix.platform == 'ubuntu-22.04'
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage
|
|
chmod +x appimagetool-x86_64.AppImage
|
|
|
|
APPIMAGE_PATH=$(find src-tauri/target/release/bundle/appimage -name "*.AppImage" | head -n 1)
|
|
echo "Patching local file: $APPIMAGE_PATH"
|
|
|
|
$APPIMAGE_PATH --appimage-extract > /dev/null
|
|
rm -f squashfs-root/usr/lib/libpcsclite.so.1
|
|
|
|
ARCH=x86_64 ./appimagetool-x86_64.AppImage --appimage-extract-and-run squashfs-root/ "$APPIMAGE_PATH"
|
|
|
|
echo "Overwriting Draft Release asset..."
|
|
gh release upload "v${{ env.version }}" "$APPIMAGE_PATH" --clobber
|
|
|
|
echo "Success! The Draft Release now has the fixed AppImage."
|