mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 09:13:02 +08:00
Update CI.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
name: dotnet package
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
dotnet-version: ['3.0', '3.1.x', '5.0.x', '6.0.x' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
|
||||
uses: actions/setup-dotnet@v1.7.2
|
||||
with:
|
||||
dotnet-version: ${{ matrix.dotnet-version }}
|
||||
- name: Install dependencies
|
||||
run: dotnet restore
|
||||
- name: Build
|
||||
run: dotnet build --configuration Release --no-restore
|
||||
- name: Test
|
||||
run: dotnet test --no-restore --verbosity normal
|
||||
@@ -1,62 +0,0 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: Deb Packaging
|
||||
|
||||
# Controls when the action will run.
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- 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
|
||||
run: dotnet publish Source/MQTTnet.Server/MQTTnet.Server.csproj --configuration Release --self-contained --runtime linux-x64 --framework net5.0
|
||||
|
||||
- name: Set up installation directory
|
||||
run: mkdir -p packaging/opt/MQTTnetServer
|
||||
|
||||
- name: Copy meta data
|
||||
run: |
|
||||
cp -R Build/deb-meta/* packaging/
|
||||
chmod 755 packaging/DEBIAN/postinst
|
||||
chmod 755 packaging/DEBIAN/postrm
|
||||
chmod 755 packaging/DEBIAN/prerm
|
||||
|
||||
- name: Move artifacts to packaging directory
|
||||
run: cp -R Source/MQTTnet.Server/bin/Release/net5.0/linux-x64/publish/* packaging/opt/MQTTnetServer
|
||||
|
||||
- name: Adjust files
|
||||
run: |
|
||||
rm packaging/opt/MQTTnetServer/appsettings.Development.json
|
||||
mv packaging/opt/MQTTnetServer/appsettings.json packaging/opt/MQTTnetServer/appsettings.template.json
|
||||
|
||||
- name: Adjust permissions
|
||||
run: |
|
||||
cd packaging/opt/MQTTnetServer
|
||||
find . -type f | xargs chmod -R 644
|
||||
chmod 755 MQTTnet.Server
|
||||
|
||||
- name: Generate MD5s
|
||||
run: |
|
||||
cd packaging/
|
||||
md5sum $(find * -type f -not -path 'DEBIAN/*') > DEBIAN/md5sums
|
||||
|
||||
- name: Patch meta
|
||||
run: sed -i 's/\VERSIONPLACEHOLDER/${{ env.VERSION }}/' packaging/DEBIAN/control
|
||||
|
||||
- name: Package everything
|
||||
run: dpkg-deb -v --build packaging/ mqttnet-server_${{ env.VERSION }}-1_amd64.deb
|
||||
|
||||
- name: Save artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: mqttnet-server
|
||||
path: mqttnet-server_${{ env.VERSION }}-1_amd64.deb
|
||||
Reference in New Issue
Block a user