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.
 
 
 
 
 

111 lines
3.6 KiB

  1. name: Build
  2. on:
  3. push:
  4. tags:
  5. - 'v*'
  6. env:
  7. BUILD_TYPE: Release
  8. jobs:
  9. prepare_release:
  10. runs-on: ubuntu-latest
  11. outputs:
  12. upload_url: ${{ steps.create_release.outputs.upload_url }}
  13. steps:
  14. - name: Create Release
  15. uses: actions/create-release@v1
  16. id: create_release
  17. with:
  18. tag_name: ${{ github.ref }}
  19. release_name: Release ${{ github.ref }}
  20. body: A release wow
  21. draft: false
  22. prerelease: false
  23. env:
  24. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  25. build_linux:
  26. runs-on: ubuntu-latest
  27. needs: [prepare_release]
  28. steps:
  29. - uses: actions/checkout@v3
  30. with:
  31. submodules: 'recursive'
  32. - name: Install dependencies
  33. # The user does not run as root
  34. run: sudo apt-get install cmake git gcc libsndfile-dev libpng-dev
  35. - name: Create Build Environment
  36. # Some projects don't allow in-source building, so create a separate build directory
  37. # We'll use this as our working directory for all subsequent commands
  38. run: cmake -E make_directory ${{runner.workspace}}/build
  39. - name: Configure CMake
  40. # Use a bash shell so we can use the same syntax for environment variable
  41. # access regardless of the host operating system
  42. shell: bash
  43. working-directory: ${{runner.workspace}}/build
  44. # Note the current convention is to use the -S and -B options here to specify source
  45. # and build directories, but this is only available with CMake 3.13 and higher.
  46. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
  47. run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
  48. - name: Build
  49. working-directory: ${{runner.workspace}}/build
  50. shell: bash
  51. # Execute the build. You can specify a specific target with "--target <NAME>"
  52. run: cmake --build . --config $BUILD_TYPE && cmake --build . --target package
  53. - name: Upload TGZ package
  54. uses: actions/upload-release-asset@v1
  55. with:
  56. upload_url: ${{ needs.prepare_release.outputs.upload_url }}
  57. asset_path: ${{runner.workspace}}/build/aptdec-${{ github.ref_name }}.x86_64.tar.gz
  58. asset_name: aptdec-${{ github.ref_name }}.x86_64.tar.gz
  59. asset_content_type: application/gzip
  60. env:
  61. GITHUB_TOKEN: ${{ github.token }}
  62. - name: Upload DEB package
  63. uses: actions/upload-release-asset@v1
  64. with:
  65. upload_url: ${{ needs.prepare_release.outputs.upload_url }}
  66. asset_path: ${{runner.workspace}}/build/aptdec-${{ github.ref_name }}.x86_64.deb
  67. asset_name: aptdec-${{ github.ref_name }}.x86_64.deb
  68. asset_content_type: application/vnd.debian.binary-package
  69. env:
  70. GITHUB_TOKEN: ${{ github.token }}
  71. build_windows:
  72. runs-on: ubuntu-latest
  73. needs: [prepare_release]
  74. steps:
  75. - uses: actions/checkout@v3
  76. with:
  77. submodules: 'recursive'
  78. - name: Install dependencies
  79. # The user does not run as root
  80. run: sudo apt install wget cmake make mingw-w64 git unzip libsndfile-dev
  81. - name: Run build script
  82. shell: bash
  83. working-directory: ${{runner.workspace}}
  84. run: cd $GITHUB_WORKSPACE && ./build_windows.sh $BUILD_TYPE
  85. - name: Upload zip
  86. uses: actions/upload-release-asset@v1
  87. with:
  88. upload_url: ${{ needs.prepare_release.outputs.upload_url }}
  89. asset_path: ${{runner.workspace}}/aptdec/winbuild/aptdec-${{ github.ref_name }}.zip
  90. asset_name: aptdec-${{ github.ref_name }}.zip
  91. asset_content_type: application/zip
  92. env:
  93. GITHUB_TOKEN: ${{ github.token }}