initial commit

This commit is contained in:
askiiart 2025-04-15 00:12:04 -05:00
commit 532c0f6903
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
3 changed files with 79 additions and 0 deletions

17
.drone.yml Normal file
View file

@ -0,0 +1,17 @@
kind: pipeline
type: docker
name: default
steps:
- name: Build <PLACEHOLDER>
image: debian
commands:
- '/drone/src/compilation.sh'
volumes:
- name: program-archives
path: /compiled
volumes:
- name: program-archives
host:
path: /mnt/user/files/repos/archives

17
README.md Normal file
View file

@ -0,0 +1,17 @@
# [Placeholder](https://github.com/PLACEHOLDER_AUTHOR/PLACEHOLDER_REPO) (build)
```
.
├── 99-filename (/etc/udev/rules.d/)
└── filename.service (/usr/lib/systemd/user/)
```
---
Install deps:
- libc
Build deps:
- gcc

45
compilation.sh Executable file
View file

@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -euo pipefail
program_name="<PLACEHOLDER>"
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
### prep
workdir=$(mktemp -d)
built_dir=${COMPILED_DIR:-/compiled}/$program_name
mkdir -p $built_dir
apt update && apt install curl jq -y
### check whether it's up-to-date
version_file=$built_dir/version
touch $version_file
version=$(curl 'https://api.github.com/repos/<PLACEHOLDER_AUTHOR>/<PLACEHOLDER_REPO>/releases/latest' | jq '.tag_name' -r)
if grep -q $version $version_file; then
echo "already up to date, exiting"
exit
fi
### get source and build
# get build deps
apt install <PLACEHOLDER >-y # zstd is for archive creation
cd $workdir
curl -L $(curl 'https://api.github.com/repos/<PLACEHOLDER_AUTHOR>/<PLACEHOLDER_REPO>/releases/latest' | jq '.tarball_url' -r) -o $program_name-$version.tar.gz
tar -xzf $program_name-$version.tar.gz
src_dir=$(find $(pwd) -name "maximbaz-wluma*")
cd $src_dir
cargo install --path .
### create .tar.zst archive
# prep
cd $src_dir
$archive_dir=$(mktemp -d)
cp $(which wluma) $archive_dir
cp <PLACEHOLDER >$archive_dir
# actually create it and finish up
cd $archive_dir
tar --zstd -cf $built_dir/$program_name.tar.zst .
echo $version >$version_file
echo "$program_name updated to $version"