From 249e9cd676dd93a10570512ff17d175638a399b6 Mon Sep 17 00:00:00 2001 From: quic_wya Date: Fri, 10 Jan 2025 12:23:10 +0800 Subject: [PATCH] Add workflow file --- .github/workflows/cmake-ubuntu-platform.yml | 74 +++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 .github/workflows/cmake-ubuntu-platform.yml diff --git a/.github/workflows/cmake-ubuntu-platform.yml b/.github/workflows/cmake-ubuntu-platform.yml new file mode 100644 index 0000000..c861985 --- /dev/null +++ b/.github/workflows/cmake-ubuntu-platform.yml @@ -0,0 +1,74 @@ +# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml +name: CMake on ubuntu platforms + +on: + push: + # branches: [ "main" ] + tags: + - 'v*' + +env: + BUILD_TYPE: Debug + +jobs: + build: + runs-on: ubuntu-22.04 + + steps: + - name: checkout branch + uses: actions/checkout@v4 + + - name: get_tag + run: echo "tag=$(git tag)" >> $GITHUB_ENV + + - name: Install Dependencies and Build + run: | + sudo apt-get install -y gcc-multilib g++-multilib + bash build.sh + tar -czvf crash-plugins_${{ env.tag }}.tar.gz output/arm64/plugins.so \ + output/arm/plugins.so + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v4 + with: + name: crash-plugins_${{ env.tag }}.tar.gz + path: crash-plugins_${{ env.tag }}.tar.gz + + release: + needs: build + runs-on: ubuntu-22.04 + + steps: + - name: checkout branch + uses: actions/checkout@v4 + + - name: get_tag + run: echo "plugin_tag=$(git tag)" >> $GITHUB_ENV + + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: crash-plugins_${{ env.plugin_tag }}.tar.gz + + - name: Release the Crash-plugins + id: release-crash + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.plugin_tag }} + release_name: crash-plugins-${{ env.plugin_tag }} + files: | + crash-plugins_${{ env.plugin_tag }}.tar.gz + + - name: Upload Release Asset + id: upload + uses: actions/upload-release-asset@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.release-crash.outputs.upload_url }} + asset_path: crash-plugins_${{ env.plugin_tag }}.tar.gz + asset_name: crash-plugins_${{ env.plugin_tag }}.tar.gz + asset_content_type: application/gzip #zip