From 859f1dc9a670e0c4f7179d4601ec9388d58f413e Mon Sep 17 00:00:00 2001 From: Yauhen Pahrabniak Date: Wed, 22 Mar 2023 14:26:48 +0100 Subject: [PATCH] Ci (#1) * CI * Auto accept * Bass.dll path fix * No linux --- .github/workflows/build-deploy.yml | 150 +++++++++++++++++++++++++++++ packages/bass-fx.lua | 6 +- packages/bass.lua | 2 +- 3 files changed, 154 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/build-deploy.yml diff --git a/.github/workflows/build-deploy.yml b/.github/workflows/build-deploy.yml new file mode 100644 index 0000000..b9a1cb3 --- /dev/null +++ b/.github/workflows/build-deploy.yml @@ -0,0 +1,150 @@ +name: Build and github release +on: + push: + +jobs: + build-windows: + name: Build windows release and debug + runs-on: windows-2019 + steps: + - name: Install XMake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: latest + + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Build + shell: cmd + run: | + xmake config -m release -k vsxmake -y + xmake build + xmake config -m debug -k vsxmake -y + xmake build + + - name: Copy files + shell: cmd + run: | + mkdir upload + mkdir upload\lib\release + mkdir upload\lib\debug + mkdir upload\include + copy build\windows\x64\release\alt-voice.lib upload\lib\release + copy build\windows\x64\debug\alt-voice.lib upload\lib\debug + copy include\alt-voice.h upload\include + + - uses: actions/upload-artifact@v3 + with: + name: alt-voice-windows + path: ./upload/ + + # build-linux: + # name: Build linux release + # runs-on: ubuntu-20.04 + # steps: + # - name: Install XMake + # uses: xmake-io/github-action-setup-xmake@v1 + # with: + # xmake-version: latest + + # - name: Checkout repository + # uses: actions/checkout@v3 + # with: + # submodules: recursive + + # - name: Build + # run: | + # xmake config -m release -y + # xmake build + + # - name: Copy files + # run: | + # mkdir -p upload + # mkdir -p upload/lib + # mkdir -p upload/include + # cp ./build/linux/x64/release/alt-voice.a ./upload/lib + # cp ./include/alt-voice.h ./upload/include + + # - uses: actions/upload-artifact@v3 + # with: + # name: alt-voice-linux + # path: ./upload/ + + create-release: + name: Create GitHub Release + runs-on: ubuntu-20.04 + # needs: [build-linux, build-windows] + needs: [build-windows] + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Download windows artifacts + uses: actions/download-artifact@v3 + with: + name: alt-voice-windows + path: dist-windows + + # - name: Download linux artifacts + # uses: actions/download-artifact@v3 + # with: + # name: alt-voice-linux + # path: dist-linux + + - name: Zip artifacts + run: | + zip -r alt-voice-windows dist-windows/* + # zip -r alt-voice-linux dist-linux/* + + - name: Set outputs + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Check outputs + run: echo ${{ steps.vars.outputs.sha_short }} + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.vars.outputs.sha_short }} + release_name: Release @${{ steps.vars.outputs.sha_short }} + + - name: Upload windows artifacts + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./alt-voice-windows.zip + asset_name: alt-voice-windows.zip + asset_content_type: application/zip + + # - name: Upload linux artifacts + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ steps.create_release.outputs.upload_url }} + # asset_path: ./alt-voice-linux.zip + # asset_name: alt-voice-linux.zip + # asset_content_type: application/zip + + delete-artifacts: + name: Delete artifacts + runs-on: ubuntu-20.04 + needs: [ create-release ] + if: ${{ always() }} + steps: + - name: Delete artifacts + uses: geekyeggo/delete-artifact@v2 + with: + name: | + alt-voice-windows + # alt-voice-linux \ No newline at end of file diff --git a/packages/bass-fx.lua b/packages/bass-fx.lua index c57ae95..504918f 100644 --- a/packages/bass-fx.lua +++ b/packages/bass-fx.lua @@ -10,12 +10,12 @@ package("bass-fx") end on_install("windows", function (package) - os.cp("c/x64/bass_fx.lib", package:installdir("lib")) + os.cp("C/x64/bass_fx.lib", package:installdir("lib")) os.cp("x64/bass_fx.dll", package:installdir("bin")) - os.cp("c/bass_fx.h", package:installdir("include")) + os.cp("C/bass_fx.h", package:installdir("include")) end) on_install("linux", function (package) os.cp("libs/x86_64/libbass_fx.so", package:installdir("bin")) - os.cp("c/bass_fx.h", package:installdir("include")) + os.cp("C/bass_fx.h", package:installdir("include")) end) \ No newline at end of file diff --git a/packages/bass.lua b/packages/bass.lua index bebfecc..a2238a8 100644 --- a/packages/bass.lua +++ b/packages/bass.lua @@ -17,5 +17,5 @@ package("bass") on_install("linux", function (package) os.cp("libs/x86_64/libbass.so", package:installdir("bin")) - os.cp("bass.h", package:installdir("include")) + os.cp("c/bass.h", package:installdir("include")) end) \ No newline at end of file