mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-20 03:24:33 +08:00
Merge pull request #5 from asymetrixs/deb-packaging
Read version from MQTTnet.Server project file
This commit is contained in:
@@ -6,15 +6,6 @@ name: Deb Packaging
|
|||||||
on:
|
on:
|
||||||
# Allows you to run this workflow manually from the Actions tab
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
FileVersion:
|
|
||||||
description: 'File Version'
|
|
||||||
required: true
|
|
||||||
default: ''
|
|
||||||
Version:
|
|
||||||
description: 'Version'
|
|
||||||
required: true
|
|
||||||
default: ''
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -23,8 +14,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Parse version
|
||||||
|
run: echo "VERSION=$(grep '<Version>' Source/MQTTnet.Server/MQTTnet.Server.csproj | grep '[0-9\.]+' -o)" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build MQTTnetServer
|
- name: Build MQTTnetServer
|
||||||
run: dotnet publish Source/MQTTnet.Server/MQTTnet.Server.csproj --configuration Release /p:FileVersion=${{ github.event.inputs.fileVersion }} /p:Version=${{ github.event.inputs.version }} --self-contained --runtime linux-x64 --framework net5.0
|
run: dotnet publish Source/MQTTnet.Server/MQTTnet.Server.csproj --configuration Release --self-contained --runtime linux-x64 --framework net5.0
|
||||||
|
|
||||||
- name: Set up installation directory
|
- name: Set up installation directory
|
||||||
run: mkdir -p packaging/opt/MQTTnetServer
|
run: mkdir -p packaging/opt/MQTTnetServer
|
||||||
@@ -56,13 +50,13 @@ jobs:
|
|||||||
md5sum $(find * -type f -not -path 'DEBIAN/*') > DEBIAN/md5sums
|
md5sum $(find * -type f -not -path 'DEBIAN/*') > DEBIAN/md5sums
|
||||||
|
|
||||||
- name: Patch meta
|
- name: Patch meta
|
||||||
run: sed -i 's/\$VERSION/${{ github.event.inputs.version }}/' packaging/DEBIAN/control
|
run: sed -i 's/\VERSIONPLACEHOLDER/${{ env.VERSION }}/' packaging/DEBIAN/control
|
||||||
|
|
||||||
- name: Package everything
|
- name: Package everything
|
||||||
run: dpkg-deb -v --build packaging/ mqttnet-server_${{ github.event.inputs.version }}-1_amd64.deb
|
run: dpkg-deb -v --build packaging/ mqttnet-server_${{ env.VERSION }}-1_amd64.deb
|
||||||
|
|
||||||
- name: Save artifact
|
- name: Save artifact
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: mqttnet-server
|
name: mqttnet-server
|
||||||
path: mqttnet-server_${{ github.event.inputs.version }}-1_amd64.deb
|
path: mqttnet-server_${{ env.VERSION }}-1_amd64.deb
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
Package: mqttnet-server
|
Package: mqttnet-server
|
||||||
Version: $VERSION
|
Version: VERSIONPLACEHOLDER
|
||||||
Section: base
|
Section: base
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
|
|||||||
Reference in New Issue
Block a user