47 lines
1.3 KiB
YAML
47 lines
1.3 KiB
YAML
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
|