Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Build tools
on:
push:
tags:
- 'v*'
jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '^1.21'
id: go

- name: Set up nFPM
run: |
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | sudo tee /etc/apt/sources.list.d/goreleaser.list
sudo apt update

- name: Install deps
run: sudo apt install -y build-essential cmake libcups2-dev libcupsimage2-dev tar gzip nfpm

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0

- name: Build
run: |
mkdir -p build
cd build
cmake ../
cmake --build .
sudo make install

tar -C / -zcvf driver.tar.gz /usr/lib/cups/filter/rastertozj /usr/share/cups/model/zjiang/zj58.ppd /usr/share/cups/model/zjiang/zj80.ppd

- name: Package
run: |
cd ci
yq e -i ".version = \"${GITHUB_REF_NAME/#v}\"" nfpm.yaml
nfpm pkg --packager deb --target ../build/zj58-amd64.deb

- name: Create release
run: |
cd build
gh release create --generate-notes "${GITHUB_REF_NAME}" zj58-amd64.deb driver.tar.gz
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24 changes: 24 additions & 0 deletions ci/nfpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "zj-58"
arch: "amd64"
platform: "linux"
section: "default"
priority: "extra"
version: "to-be-replaced"
provides:
- zj-58
depends:
- libcups2
- libcupsimage2
maintainer: "Aleksey N. Vinogradov <a.n.vinogradov@gmail.com>"
description: |
CUPS filter for thermal printers as Zjiang ZJ-58, XPrinter XP-58, etc
vendor: "Zjiang"
homepage: "https://github.com/klirichek/zj-58"
license: "BSD-2-Clause"
contents:
- src: /usr/lib/cups/filter/rastertozj
dst: /usr/lib/cups/filter/rastertozj
- src: /usr/share/cups/model/zjiang/zj58.ppd
dst: /usr/share/cups/model/zjiang/zj58.ppd
- src: /usr/share/cups/model/zjiang/zj80.ppd
dst: /usr/share/cups/model/zjiang/zj80.ppd