This commit is contained in:
parent
9c269f2612
commit
094b653c2b
3 changed files with 65 additions and 0 deletions
47
.forgejo/workflows/build.yaml
Normal file
47
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,47 @@
|
|||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: debian:bookworm
|
||||
|
||||
steps:
|
||||
- run: |-
|
||||
apt update
|
||||
apt install -y nodejs git curl golang
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- run: go build -o bitvis-http
|
||||
|
||||
- name: Build Debian package
|
||||
run: |-
|
||||
mkdir -p deb/DEBIAN
|
||||
cat <<EOF | tee deb/DEBIAN/control
|
||||
Package: bitvis-http
|
||||
Version: 0.$(date --date="@$(git show -s --format='%ct' HEAD)" '+%4Y%m%d.%H%M%S')
|
||||
Section: base
|
||||
Priority: optional
|
||||
Architecture: amd64
|
||||
Maintainer: polyfloyd <floy@polyfloyd.net>
|
||||
Description: Virtual BitPanel over HTTP
|
||||
EOF
|
||||
install -D -m 0755 support/postinst deb/DEBIAN/postinst
|
||||
install -D -m 0755 bitvis-http deb/usr/bin/bitvis-http
|
||||
install -D support/systemd.service deb/lib/systemd/system/bitvis-http.service
|
||||
|
||||
dpkg-deb --build deb bitvis-http.deb
|
||||
|
||||
- name: Deploy Debian package
|
||||
run: |-
|
||||
curl \
|
||||
--fail \
|
||||
--user ${{ secrets.PKG_RELEASE_CREDENTIALS }} \
|
||||
--upload-file bitvis-http.deb \
|
||||
$GITHUB_SERVER_URL/api/packages/$GITHUB_REPOSITORY_OWNER/debian/pool/stable/main/upload
|
5
support/postinst
Normal file
5
support/postinst
Normal file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl restart bitvis-http.service
|
||||
systemctl enable bitvis-http.service
|
13
support/systemd.service
Normal file
13
support/systemd.service
Normal file
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=Virtual BitPanel over HTTP
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
ExecStart=/usr/bin/bitvis-http
|
||||
DynamicUser=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Add table
Add a link
Reference in a new issue