From ea88a8c0def1e9c6cc06dfbec153439366528c57 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 6 Jan 2022 20:10:42 +0100 Subject: [PATCH] Update CI. --- .github/workflows/ci.yml | 24 +++++++++++ .github/workflows/deb-packaging.yml | 62 ----------------------------- 2 files changed, 24 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/deb-packaging.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3085e76 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/deb-packaging.yml b/.github/workflows/deb-packaging.yml deleted file mode 100644 index 36aa7ee..0000000 --- a/.github/workflows/deb-packaging.yml +++ /dev/null @@ -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 '' 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