79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
name: "Build Linux Bundle"
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
push_to_cache:
|
|
description: "Push to Nix Cache"
|
|
required: false
|
|
type: boolean
|
|
default: false
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- name: 📥 Clone repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: ❄ Install Nix
|
|
uses: DeterminateSystems/nix-installer-action@main
|
|
|
|
- name: 🗑 Free disk space
|
|
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache
|
|
|
|
- name: 📦 Build Nix package
|
|
run: nix build --no-link --print-out-paths
|
|
|
|
- name: 📤 Push to Nix cache
|
|
if: github.ref == 'refs/heads/master' || inputs.push_to_cache == true
|
|
env:
|
|
NIX_CACHE_AUTH_TOKEN: ${{ secrets.NIX_CACHE_AUTH_TOKEN }}
|
|
run: |
|
|
nix run nixpkgs#cachix -- authtoken $NIX_CACHE_AUTH_TOKEN
|
|
nix build --no-link --print-out-paths | nix run nixpkgs#cachix -- push graphite
|
|
|
|
- name: 🏗 Build Linux bundle
|
|
run: nix build .#graphite-bundle.tar.xz && cp ./result ./graphite-linux-bundle.tar.xz
|
|
|
|
- name: 📦 Upload Linux bundle
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: graphite-linux-bundle
|
|
path: graphite-linux-bundle.tar.xz
|
|
compression-level: 0
|
|
|
|
- name: 🔧 Install Flatpak tooling
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y flatpak flatpak-builder
|
|
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
|
|
- name: 🏗 Build Flatpak
|
|
run: |
|
|
nix build .#graphite-flatpak-manifest
|
|
|
|
rm -rf .flatpak
|
|
mkdir -p .flatpak
|
|
|
|
cp ./result .flatpak/manifest.json
|
|
|
|
cd .flatpak
|
|
mkdir -p repo
|
|
|
|
flatpak-builder --user --force-clean --install-deps-from=flathub --repo=repo build ./manifest.json
|
|
|
|
flatpak build-bundle repo Graphite.flatpak art.graphite.Graphite --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
|
|
|
|
- name: 📦 Upload Flatpak package
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: graphite-flatpak
|
|
path: .flatpak/Graphite.flatpak
|
|
compression-level: 0
|