No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 

98 líneas
2.9 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@v2
  30. - name: Install dependencies
  31. # The user does not run as root
  32. run: sudo apt-get install cmake git gcc libsndfile-dev libpng-dev
  33. - name: Create Build Environment
  34. # Some projects don't allow in-source building, so create a separate build directory
  35. # We'll use this as our working directory for all subsequent commands
  36. run: cmake -E make_directory ${{runner.workspace}}/build
  37. - name: Configure CMake
  38. # Use a bash shell so we can use the same syntax for environment variable
  39. # access regardless of the host operating system
  40. shell: bash
  41. working-directory: ${{runner.workspace}}/build
  42. # Note the current convention is to use the -S and -B options here to specify source
  43. # and build directories, but this is only available with CMake 3.13 and higher.
  44. # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
  45. run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
  46. - name: Build
  47. working-directory: ${{runner.workspace}}/build
  48. shell: bash
  49. # Execute the build. You can specify a specific target with "--target <NAME>"
  50. run: cmake --build . --config $BUILD_TYPE
  51. - name: Upload binary
  52. uses: actions/upload-release-asset@v1
  53. with:
  54. upload_url: ${{ needs.prepare_release.outputs.upload_url }}
  55. asset_path: ./${{runner.workspace}}/aptdec/build/aptdec
  56. asset_name: aptdec_lin64
  57. asset_content_type: application/x-executable
  58. env:
  59. GITHUB_TOKEN: ${{ github.token }}
  60. build_windows:
  61. runs-on: ubuntu-latest
  62. needs: [prepare_release]
  63. steps:
  64. - uses: actions/checkout@v2
  65. - name: Install dependencies
  66. # The user does not run as root
  67. run: sudo apt install wget cmake make mingw-w64 git unzip libsndfile-dev
  68. - name: Run build script
  69. shell: bash
  70. working-directory: ${{runner.workspace}}
  71. run: cd $GITHUB_WORKSPACE && ./build_windows.sh $BUILD_TYPE
  72. - name: Upload zip
  73. uses: actions/upload-release-asset@v1
  74. with:
  75. upload_url: ${{ needs.prepare_release.outputs.upload_url }}
  76. asset_path: ./${{runner.workspace}}/aptdec/winbuild/aptdec-1.7.0.zip
  77. asset_name: aptdec_win64.zip
  78. asset_content_type: application/zip
  79. env:
  80. GITHUB_TOKEN: ${{ github.token }}