chore: fix ci
This commit is contained in:
69
.github/workflows/release.yml
vendored
69
.github/workflows/release.yml
vendored
@@ -5,8 +5,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "v*"
|
- "v*"
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -31,6 +29,9 @@ jobs:
|
|||||||
- platform: linux-x64
|
- platform: linux-x64
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
target: x86_64-unknown-linux-gnu
|
target: x86_64-unknown-linux-gnu
|
||||||
|
- platform: linux-arm64
|
||||||
|
os: ubuntu-latest
|
||||||
|
target: aarch64-unknown-linux-gnu
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
@@ -42,21 +43,22 @@ jobs:
|
|||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
|
||||||
# Windows and macOS builds using cargo-packager
|
# Windows and macOS builds using cargo-packager
|
||||||
- name: Install cargo-packager
|
|
||||||
if: runner.os != 'Linux'
|
|
||||||
run: cargo install cargo-packager --locked
|
|
||||||
|
|
||||||
- name: Build with cargo-packager (Windows/macOS)
|
- name: Build with cargo-packager (Windows/macOS)
|
||||||
if: runner.os != 'Linux'
|
if: runner.os != 'Linux'
|
||||||
working-directory: crates/coop
|
working-directory: crates/coop
|
||||||
run: cargo packager --release --target ${{ matrix.target }} --config before-packaging-command="cargo build --release --target ${{ matrix.target }}"
|
run: |
|
||||||
|
cargo install cargo-packager --locked
|
||||||
|
cargo packager --release --target ${{ matrix.target }} --config before-packaging-command="cargo build --release --target ${{ matrix.target }}"
|
||||||
|
|
||||||
- name: Upload Windows/macOS artifacts
|
- name: Upload Windows/macOS artifacts
|
||||||
if: runner.os != 'Linux'
|
if: runner.os != 'Linux'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.platform }}-artifacts
|
name: ${{ matrix.platform }}-artifacts
|
||||||
path: crates/coop/dist/**/*
|
path: |
|
||||||
|
crates/coop/dist/*.dmg
|
||||||
|
crates/coop/dist/*.msi
|
||||||
|
crates/coop/dist/*.exe
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
# Linux builds using custom scripts
|
# Linux builds using custom scripts
|
||||||
@@ -65,32 +67,71 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y flatpak flatpak-builder snapd squashfs-tools jq gettext-base
|
sudo apt-get install -y flatpak flatpak-builder snapd squashfs-tools jq gettext-base
|
||||||
sudo snap install snapcraft --classic
|
|
||||||
|
# Install cross-compilation tools for ARM64
|
||||||
|
- name: Install ARM64 cross-compilation tools
|
||||||
|
if: runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
||||||
|
|
||||||
|
- name: Configure cross-compilation environment
|
||||||
|
if: runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
echo "CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
||||||
|
echo "CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++" >> $GITHUB_ENV
|
||||||
|
echo "AR_aarch64_unknown_linux_gnu=aarch64-linux-gnu-ar" >> $GITHUB_ENV
|
||||||
|
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Install Snapcraft
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
run: sudo snap install snapcraft --classic
|
||||||
|
|
||||||
- name: Make scripts executable
|
- name: Make scripts executable
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
run: |
|
run: |
|
||||||
chmod +x script/get-crate-version
|
chmod +x script/get-crate-version
|
||||||
|
chmod +x script/linux
|
||||||
chmod +x script/snap-build
|
chmod +x script/snap-build
|
||||||
chmod +x script/bundle-linux
|
chmod +x script/bundle-linux
|
||||||
chmod +x script/flatpak/deps
|
chmod +x script/flatpak/deps
|
||||||
chmod +x script/flatpak/bundle-flatpak
|
chmod +x script/flatpak/bundle-flatpak
|
||||||
|
|
||||||
- name: Build Flatpak
|
- name: Install required dependencies
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux'
|
||||||
|
working-directory: script
|
||||||
|
run: ./linux
|
||||||
|
|
||||||
|
# Only build Flatpak and Snap for x86_64 (most common use case)
|
||||||
|
- name: Build Flatpak (x86_64 only)
|
||||||
|
if: runner.os == 'Linux' && matrix.target == 'x86_64-unknown-linux-gnu'
|
||||||
working-directory: script/flatpak
|
working-directory: script/flatpak
|
||||||
run: |
|
run: |
|
||||||
./deps
|
./deps
|
||||||
./bundle-flatpak
|
./bundle-flatpak
|
||||||
|
|
||||||
- name: Build Snap
|
- name: Build Snap (x86_64 only)
|
||||||
if: runner.os == 'Linux'
|
if: runner.os == 'Linux' && matrix.target == 'x86_64-unknown-linux-gnu'
|
||||||
run: |
|
run: |
|
||||||
VERSION=$(script/get-crate-version coop)
|
VERSION=$(script/get-crate-version coop)
|
||||||
script/snap-build $VERSION
|
script/snap-build $VERSION
|
||||||
|
|
||||||
- name: Collect Linux artifacts
|
# For ARM64, build a simple binary package
|
||||||
if: runner.os == 'Linux'
|
- name: Build ARM64 binary
|
||||||
|
if: runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
cargo build --release --target ${{ matrix.target }}
|
||||||
|
|
||||||
|
- name: Create ARM64 tarball
|
||||||
|
if: runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
|
||||||
|
run: |
|
||||||
|
VERSION=$(script/get-crate-version coop)
|
||||||
|
mkdir -p linux-artifacts
|
||||||
|
cd target/aarch64-unknown-linux-gnu/release
|
||||||
|
tar -czf ../../../linux-artifacts/coop-${VERSION}-linux-aarch64.tar.gz coop
|
||||||
|
ls -la ../../../linux-artifacts/
|
||||||
|
|
||||||
|
- name: Collect Linux x86_64 artifacts
|
||||||
|
if: runner.os == 'Linux' && matrix.target == 'x86_64-unknown-linux-gnu'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p linux-artifacts
|
mkdir -p linux-artifacts
|
||||||
# Find and copy flatpak files
|
# Find and copy flatpak files
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ description = "Chat Freely, Stay Private on Nostr"
|
|||||||
identifier = "su.reya.coop"
|
identifier = "su.reya.coop"
|
||||||
category = "SocialNetworking"
|
category = "SocialNetworking"
|
||||||
version = "1.0.0-beta"
|
version = "1.0.0-beta"
|
||||||
out-dir = "./dist"
|
out-dir = "../../dist"
|
||||||
before-packaging-command = "cargo build --release"
|
before-packaging-command = "cargo build --release"
|
||||||
resources = ["Cargo.toml", "src"]
|
resources = ["Cargo.toml", "src"]
|
||||||
icons = [
|
icons = [
|
||||||
|
|||||||
@@ -207,7 +207,6 @@ fn main() {
|
|||||||
window_background: WindowBackgroundAppearance::Opaque,
|
window_background: WindowBackgroundAppearance::Opaque,
|
||||||
window_decorations: Some(WindowDecorations::Client),
|
window_decorations: Some(WindowDecorations::Client),
|
||||||
window_bounds: Some(WindowBounds::Windowed(bounds)),
|
window_bounds: Some(WindowBounds::Windowed(bounds)),
|
||||||
window_min_size: Some(size(px(800.0), px(600.0))),
|
|
||||||
kind: WindowKind::Normal,
|
kind: WindowKind::Normal,
|
||||||
app_id: Some(APP_ID.to_owned()),
|
app_id: Some(APP_ID.to_owned()),
|
||||||
titlebar: Some(TitlebarOptions {
|
titlebar: Some(TitlebarOptions {
|
||||||
|
|||||||
Reference in New Issue
Block a user