Files
picoforge/.github/workflows/release.yml
T
Suyog TandelandGitHub c046f60ef0 chore(ci/cd): Modify release workflow to build gpui version of the application and fix appimages (#64)
* fix(ci/cd): release build workflow failing due to wrong github action syntax

* feat(ci/cd): add appimage build script that uses linuxdeploy

* feat(ci/cd): add caching to release workflow
2026-02-19 12:27:34 +05:30

164 lines
5.8 KiB
YAML

name: "publish-stable"
on:
push:
branches:
- release
workflow_dispatch:
jobs:
publish-tauri:
permissions:
contents: write
issues: write
pull-requests: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above)
args: "--target aarch64-apple-darwin"
- platform: "macos-latest" # for Intel based macs
args: "--target x86_64-apple-darwin"
- platform: "ubuntu-22.04"
args: ""
- platform: "ubuntu-24.04-arm"
args: ""
- platform: "windows-latest" # Windows x64
args: "--target x86_64-pc-windows-msvc"
- platform: "windows-latest" # Windows x86 (32-bit)
args: "--target i686-pc-windows-msvc"
- platform: "windows-latest" # Windows ARM64
args: "--target aarch64-pc-windows-msvc"
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- 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: Cache Cargo registry and target
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.platform }}-${{ matrix.args }}
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
run: |
sudo apt-get update
sudo apt install -y \
build-essential \
pkg-config \
libssl-dev \
libpcsclite-dev \
libudev-dev \
libvulkan-dev \
vulkan-tools \
libwayland-dev \
wayland-protocols \
libxkbcommon-dev \
libxcb1-dev \
libxkbcommon-x11-dev \
libfontconfig1-dev \
libasound2-dev \
libdbus-1-dev \
file \
desktop-file-utils \
libx11-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev libusb-1.0-0-dev podman patchelf librsvg2-dev libappindicator3-dev libwebkit2gtk-4.1-dev
- name: install dependencies (ubuntu-arm64 only)
if: matrix.platform == 'ubuntu-24.04-arm'
run: |
sudo apt-get install xdg-utils
- name: Extract version from Cargo.toml
id: get_version
shell: bash
run: |
# Define the path to your Cargo.toml file
cargo_file="Cargo.toml"
# Extract ONLY the version number using a more precise regex
version=$(grep -m 1 '^version' "$cargo_file" | sed -E 's/.*"([0-9]+\.[0-9]+\.[0-9]+)".*/\1/')
# Output for debugging
echo "Version found: $version"
# Set the output correctly for GitHub Actions
echo "version=$version" >> $GITHUB_ENV
- name: install cargo-packager
uses: taiki-e/install-action@v2
with:
tool: cargo-packager
- name: Build Binary
run: cargo build --release ${{ matrix.args }}
- name: Build and Package (Linux)
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
run: cargo packager --release --formats deb,pacman
- name: Build AppImage
if: matrix.platform == 'ubuntu-22.04' || matrix.platform == 'ubuntu-24.04-arm'
run: |
chmod +x .github/scripts/build_appimage.sh
./.github/scripts/build_appimage.sh
- name: Build and Package
if: matrix.platform != 'ubuntu-22.04' && matrix.platform != 'ubuntu-24.04-arm'
run: cargo packager --release ${{ matrix.args }}
- name: Upload Release Assets
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.version }}
name: "PicoForge-v${{ env.version }}"
body: |
> [!WARNING]
> This is a Beta release and thus can have some bugs, report them using github issues.
#### Check the Installation guide for the Application on the wiki: https://github.com/librekeys/picoforge/wiki/Installation
prerelease: false
files: |
target/release/*.deb
target/release/*.appimage
target/release/*.AppImage
target/release/*.tar.gz
target/release/*.msi
target/release/*.dmg
target/release/*.app
target/x86_64-apple-darwin/release/*.dmg
target/aarch64-apple-darwin/release/*.dmg
target/x86_64-apple-darwin/release/*.app
target/aarch64-apple-darwin/release/*.app
target/x86_64-pc-windows-msvc/release/*.msi
target/x86_64-pc-windows-msvc/release/*.exe
target/i686-pc-windows-msvc/release/*.msi
target/i686-pc-windows-msvc/release/*.exe
target/aarch64-pc-windows-msvc/release/*.msi
target/aarch64-pc-windows-msvc/release/*.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sync Spec Version & Tag
if: matrix.platform == 'ubuntu-22.04'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
chmod +x .github/scripts/sync_spec_version.sh
podman run --rm \
--security-opt label=disable \
-v "$PWD":/workspace \
-w /workspace \
-e GITHUB_TOKEN=$GITHUB_TOKEN \
-e GITHUB_REPOSITORY=$GITHUB_REPOSITORY \
fedora:latest \
/workspace/.github/scripts/sync_spec_version.sh