Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 

102 linhas
3.0 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
  53. - name: Upload binary
  54. uses: actions/upload-release-asset@v1
  55. with:
  56. upload_url: ${{ needs.prepare_release.outputs.upload_url }}
  57. asset_path: ./${{runner.workspace}}/aptdec/build/aptdec
  58. asset_name: aptdec_lin64
  59. asset_content_type: application/x-executable
  60. env:
  61. GITHUB_TOKEN: ${{ github.token }}
  62. build_windows:
  63. runs-on: ubuntu-latest
  64. needs: [prepare_release]
  65. steps:
  66. - uses: actions/checkout@v3
  67. with:
  68. submodules: 'recursive'
  69. - name: Install dependencies
  70. # The user does not run as root
  71. run: sudo apt install wget cmake make mingw-w64 git unzip libsndfile-dev
  72. - name: Run build script
  73. shell: bash
  74. working-directory: ${{runner.workspace}}
  75. run: cd $GITHUB_WORKSPACE && ./build_windows.sh $BUILD_TYPE
  76. - name: Upload zip
  77. uses: actions/upload-release-asset@v1
  78. with:
  79. upload_url: ${{ needs.prepare_release.outputs.upload_url }}
  80. asset_path: ./${{runner.workspace}}/aptdec/winbuild/aptdec-1.7.0.zip
  81. asset_name: aptdec_win64.zip
  82. asset_content_type: application/zip
  83. env:
  84. GITHUB_TOKEN: ${{ github.token }}