You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

63 rivejä
2.0 KiB

  1. # This is a basic workflow to help you get started with Actions
  2. name: Deb Packaging
  3. # Controls when the action will run.
  4. on:
  5. # Allows you to run this workflow manually from the Actions tab
  6. workflow_dispatch
  7. jobs:
  8. build:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - uses: actions/checkout@v2
  12. - name: Parse version
  13. run: echo VERSION=$(grep '<Version>' Source/MQTTnet.Server/MQTTnet.Server.csproj | grep [0-9\.]* -o) >> $GITHUB_ENV
  14. - name: Build MQTTnetServer
  15. run: dotnet publish Source/MQTTnet.Server/MQTTnet.Server.csproj --configuration Release --self-contained --runtime linux-x64 --framework net5.0
  16. - name: Set up installation directory
  17. run: mkdir -p packaging/opt/MQTTnetServer
  18. - name: Copy meta data
  19. run: |
  20. cp -R Build/deb-meta/* packaging/
  21. chmod 755 packaging/DEBIAN/postinst
  22. chmod 755 packaging/DEBIAN/postrm
  23. chmod 755 packaging/DEBIAN/prerm
  24. - name: Move artifacts to packaging directory
  25. run: cp -R Source/MQTTnet.Server/bin/Release/net5.0/linux-x64/publish/* packaging/opt/MQTTnetServer
  26. - name: Adjust files
  27. run: |
  28. rm packaging/opt/MQTTnetServer/appsettings.Development.json
  29. mv packaging/opt/MQTTnetServer/appsettings.json packaging/opt/MQTTnetServer/appsettings.template.json
  30. - name: Adjust permissions
  31. run: |
  32. cd packaging/opt/MQTTnetServer
  33. find . -type f | xargs chmod -R 644
  34. chmod 755 MQTTnet.Server
  35. - name: Generate MD5s
  36. run: |
  37. cd packaging/
  38. md5sum $(find * -type f -not -path 'DEBIAN/*') > DEBIAN/md5sums
  39. - name: Patch meta
  40. run: sed -i 's/\VERSIONPLACEHOLDER/${{ env.VERSION }}/' packaging/DEBIAN/control
  41. - name: Package everything
  42. run: dpkg-deb -v --build packaging/ mqttnet-server_${{ env.VERSION }}-1_amd64.deb
  43. - name: Save artifact
  44. uses: actions/upload-artifact@v2
  45. with:
  46. name: mqttnet-server
  47. path: mqttnet-server_${{ env.VERSION }}-1_amd64.deb