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: Cache Node.js modules uses: actions/cache@v4 with: path: frontend/node_modules key: ${{ runner.os }}-node-${{ hashFiles('frontend/package-lock.json') }} restore-keys: | ${{ runner.os }}-node- - 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: | cd frontend npm install npm run build - run: ~/.cargo/bin/cargo build -r - run: | curl -X POST \ -H "Authorization: token ${{ github.token }}" \ -F "attachment=@target/release/bot" \ "${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets" - run: | export XDG_RUNTIME_DIR=/run/user/$(id -u) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus systemctl --user stop bot cp target/release/bot ~/bot/bot chmod +x ~/bot/bot mkdir -p ~/bot/fe rm -rf ~/bot/fe/* cp -r frontend/dist/* ~/bot/fe/ systemctl --user start bot