Skip to content

implement reboot syscall in nim, move hotkey handlers to own file #31

implement reboot syscall in nim, move hotkey handlers to own file

implement reboot syscall in nim, move hotkey handlers to own file #31

Workflow file for this run

name: Nightly
on:
push:
branches:
- devel
jobs:
nightly:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Set up Nim
uses: jiro4989/setup-nim-action@v2
with:
nim-version: '2.2.6'
- name: Cache Nim packages
uses: actions/cache@v4
with:
path: |
~/.nimble
~/.cache/nim
key: ${{ runner.os }}-nimble-${{ hashFiles('*.nimble') }}
restore-keys: |
${{ runner.os }}-nimble-
- name: Install Zig
uses: goto-bus-stop/setup-zig@v2
with:
version: 0.15.2
- name: Cache Zig
uses: actions/cache@v4
with:
path: |
~/.cache/zig
${{ github.workspace }}/zig-cache
key: ${{ runner.os }}-zig-0.15.2-${{ hashFiles('**/*.zig', 'build.zig', 'build.zig.zon') }}
restore-keys: |
${{ runner.os }}-zig-0.15.2-
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: armv7-unknown-linux-musleabihf
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock', '**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install cmake binutils-arm-linux-gnueabihf openssh-client -y
- name: Install cargo-zigbuild
run: |
if ! command -v cargo-zigbuild &> /dev/null; then
cargo install cargo-zigbuild
fi
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install Nim zigcc wrapper
run: |
if ! nimble path zigcc &> /dev/null 2>&1; then
nimble install zigcc -y
fi
- name: Get commit info
id: hash
run: |
HASH=$(git rev-parse --short=8 HEAD)
COMMIT_MSG=$(git log -1 --pretty=%B | head -n 1)
echo "hash=$HASH" >> $GITHUB_OUTPUT
echo "commit_msg=$COMMIT_MSG" >> $GITHUB_OUTPUT
echo "Commit: $HASH - $COMMIT_MSG"
- name: Build nightly
run: NIGHTLY=1 nimble updater -y --verbose
- name: Delete old continuous release
run: "gh release delete nightly -y --cleanup-tag || true"
env:
GH_TOKEN: ${{ github.token }}
- name: Create continuous release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
release_name: "Continuous build"
body: |
Automated build of the latest commit. Do note that these builds are not stable.
For stable releases, see the [releases page](https://github.com/${{ github.repository }}/releases).
**Commit:** `${{ steps.hash.outputs.hash }}`
**Message:** ${{ steps.hash.outputs.commit_msg }}
**Built:** ${{ github.event.head_commit.timestamp }}
draft: false
prerelease: true
- name: Upload BASE zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Quark-${{ steps.hash.outputs.hash }}-BASE.zip
asset_name: Quark-${{ steps.hash.outputs.hash }}-BASE.zip
asset_content_type: application/zip
- name: Upload Updater zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Quark-${{ steps.hash.outputs.hash }}-Updater.zip
asset_name: Quark-${{ steps.hash.outputs.hash }}-Updater.zip
asset_content_type: application/zip
- name: Upload via SFTP
env:
SFTP_KEY: ${{ secrets.SFTP_KEY }}
run: |
# Save SSH key to file
echo "$SFTP_KEY" > /tmp/sftp_key
chmod 600 /tmp/sftp_key
# Upload file
sftp -o StrictHostKeyChecking=accept-new -i /tmp/sftp_key debian@q.sartor.vip <<EOF
put Quark-${{ steps.hash.outputs.hash }}-Updater.zip /var/www/qstore/store/packages/vip.sartor.q.nightly.zip
bye
EOF
# Clean up key
rm /tmp/sftp_key