53 lines
1.9 KiB
YAML
53 lines
1.9 KiB
YAML
on:
|
|
release:
|
|
types: [published]
|
|
jobs:
|
|
upload:
|
|
runs-on: host
|
|
permissions:
|
|
packages: write
|
|
steps:
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
- uses: actions/checkout@v6
|
|
- name: Install packaging deps (Linux + Windows cross-build)
|
|
run: sudo apt-get update && sudo apt-get install -y rpm wine64 nsis
|
|
- run: npm ci
|
|
- run: npm run dist:linux
|
|
- run: npm run dist:win
|
|
- name: Copy installers into static folder
|
|
run: |
|
|
mkdir -p static/installers
|
|
find static/installers -mindepth 1 -maxdepth 1 -type f -delete
|
|
find dist -maxdepth 1 -type f \( -name '*.rpm' -o -name '*.AppImage' -o -name '*.deb' -o -name '*.exe' -o -name '*.msi' \) -exec cp {} static/installers/ \;
|
|
- name: Cache Cargo registry
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/bin/
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/cache/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
- name: Cache Cargo target
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: target/
|
|
key: ${{ runner.os }}-cargo-target-${{ hashFiles('Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-target-
|
|
- run: ~/.cargo/bin/cargo build -r
|
|
- run: |
|
|
export XDG_RUNTIME_DIR=/run/user/$(id -u)
|
|
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
|
|
systemctl --user stop discord
|
|
mkdir -p ~/discord
|
|
cp target/release/chattz ~/discord/discord
|
|
chmod +x ~/discord/discord
|
|
mkdir -p ~/discord/static/uploads
|
|
find ~/discord/static -mindepth 1 -maxdepth 1 ! -name 'uploads' -exec rm -rf {} +
|
|
cp -r static/* ~/discord/static/
|
|
systemctl --user start discord
|