Skip to content

Commit b2f1dde

Browse files
committed
Merge branch 'master' of https://github.com/Tim-Maes/PrintZPL
2 parents da59c10 + 38ea9b5 commit b2f1dde

File tree

2 files changed

+66
-40
lines changed

2 files changed

+66
-40
lines changed

.github/workflows/build.yml

Lines changed: 58 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,67 @@
1-
name: Build and Publish Executable
1+
name: Build & Publish Executables
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
7+
tags:
8+
- 'v*.*.*'
69
workflow_dispatch:
710

11+
env:
12+
CONFIGURATION: Release
13+
PROJECT_PATH: src/PrintZPL.Host/PrintZPL.Host.csproj
14+
FRAMEWORK: net8.0
15+
816
jobs:
9-
build:
17+
publish:
1018
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
runtime:
23+
- win-x64
24+
- linux-x64
25+
- osx-x64
1126

1227
steps:
13-
- uses: actions/checkout@v2
14-
15-
- name: Set up .NET
16-
uses: actions/setup-dotnet@v1
17-
with:
18-
dotnet-version: '6.0'
19-
20-
- name: Publish Windows Executable
21-
run: dotnet publish ./src/PrintZPL.Host/PrintZPL.Host.csproj -r win-x64 -c Release /p:PublishSingleFile=true --self-contained true
22-
23-
- name: Publish Linux Executable
24-
run: dotnet publish ./src/PrintZPL.Host/PrintZPL.Host.csproj -r linux-x64 -c Release /p:PublishSingleFile=true --self-contained true
25-
26-
- name: Publish macOS Executable
27-
run: dotnet publish ./src/PrintZPL.Host/PrintZPL.Host.csproj -r osx-x64 -c Release /p:PublishSingleFile=true --self-contained true
28-
29-
- name: Upload Windows Executable
30-
uses: actions/upload-artifact@v2
31-
with:
32-
name: PrintZPL-win-x64
33-
path: src/PrintZPL.Host/bin/Release/net6.0/win-x64/publish/
34-
35-
- name: Upload Linux Executable
36-
uses: actions/upload-artifact@v2
37-
with:
38-
name: PrintZPL-linux-x64
39-
path: src/PrintZPL.Host/bin/Release/net6.0/linux-x64/publish/
40-
41-
- name: Upload macOS Executable
42-
uses: actions/upload-artifact@v2
43-
with:
44-
name: PrintZPL-osx-x64
45-
path: src/PrintZPL.Host/bin/Release/net6.0/osx-x64/publish/
28+
- name: Checkout repository
29+
uses: actions/checkout@v3
30+
31+
- name: Setup .NET 6 SDK
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: '8.0.x'
35+
36+
- name: Cache NuGet packages
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.nuget/packages
40+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
41+
restore-keys: ${{ runner.os }}-nuget-
42+
43+
- name: Restore dependencies
44+
run: dotnet restore "${{ env.PROJECT_PATH }}"
45+
46+
- name: Publish single-file executable (${{ matrix.runtime }})
47+
run: |
48+
dotnet publish "${{ env.PROJECT_PATH }}" \
49+
-c ${{ env.CONFIGURATION }} \
50+
-r ${{ matrix.runtime }} \
51+
--self-contained true \
52+
/p:PublishSingleFile=true \
53+
/p:PublishTrimmed=true \
54+
/p:TrimMode=Link
55+
56+
- name: Zip published output (${{ matrix.runtime }})
57+
run: |
58+
PUBLISH_DIR="src/PrintZPL.Host/bin/${{ env.CONFIGURATION }}/${{ env.FRAMEWORK }}/${{ matrix.runtime }}/publish"
59+
ZIP_NAME="PrintZPL-${{ matrix.runtime }}.zip"
60+
cd "$PUBLISH_DIR"
61+
zip -r "${{ github.workspace }}/$ZIP_NAME" .
62+
63+
- name: Upload artifact for ${{ matrix.runtime }}
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: PrintZPL-${{ matrix.runtime }}
67+
path: PrintZPL-${{ matrix.runtime }}.zip

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
# PrintZPL
22

33
## Description
4-
This service allows you to discover Zebra printers and send/print ZPL templates by using HTTP POST requests.
4+
PrintZPL is a lightweight web service to discover Zebra printers via mDNS and send ZPL templates over TCP using simple HTTP calls.
55

66
## Installation
77

8+
### Pre-reqs
9+
10+
- [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0)
11+
812
### Download and run as service
913

10-
- [PrintZPL-win-x64](https://github.com/Tim-Maes/PrintZPL/actions/runs/7247084396/artifacts/1121113118) for Windows
11-
- [PrintZPL-linux-x64](https://github.com/Tim-Maes/PrintZPL/actions/runs/7247084396/artifacts/1121113116) for Linux
12-
- [PrintZPL-osx-x65](https://github.com/Tim-Maes/PrintZPL/actions/runs/7247084396/artifacts/1121113117) for MaxOS
14+
- [PrintZPL-win-x64](https://github.com/Tim-Maes/PrintZPL/actions/runs/14935544402/artifacts/3096169978) for Windows
15+
- [PrintZPL-linux-x64](https://github.com/Tim-Maes/PrintZPL/actions/runs/14935544402/artifacts/3096169686) for Linux
16+
- [PrintZPL-osx-x65](https://github.com/Tim-Maes/PrintZPL/actions/runs/14935544402/artifacts/3096170002) for macOS
1317

1418
## The API
1519

0 commit comments

Comments
 (0)