diff options
author | Wei Shuai <cpuwolf@gmail.com> | 2021-05-20 14:18:03 +0800 |
---|---|---|
committer | Wei Shuai <cpuwolf@sina.com> | 2021-05-22 12:59:10 +0800 |
commit | a37a7e27c77245d5da8c5a7190373bf22592b12a (patch) | |
tree | 7209a88a6ba41b3a9e026c849e5a084d8e630268 /.github | |
parent | 0d92f98042b395fe45bd4f8d73de209153d3c72d (diff) |
add workflows
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/cmake.yml | 53 | ||||
-rw-r--r-- | .github/workflows/cmake_tags.yml | 91 |
2 files changed, 144 insertions, 0 deletions
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml new file mode 100644 index 00000000..bcaea3d5 --- /dev/null +++ b/.github/workflows/cmake.yml @@ -0,0 +1,53 @@ +name: CMake + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-latest] + + steps: + - uses: actions/checkout@v2 + + - name: Cache Qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-QtCache + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + cached: ${{ steps.cache-qt.outputs.cache-hit }} + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type + run: cmake -S ${{github.workspace}}/ -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: Upload build + uses: actions/upload-artifact@v2 + with: + name: buildoutput + path: ${{github.workspace}}/build/ diff --git a/.github/workflows/cmake_tags.yml b/.github/workflows/cmake_tags.yml new file mode 100644 index 00000000..4f926142 --- /dev/null +++ b/.github/workflows/cmake_tags.yml @@ -0,0 +1,91 @@ +name: CMakeTags + +on: + push: + tags: + - '*' + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + # The CMake configure and build commands are platform agnostic and should work equally + # well on Windows or Mac. You can convert this to a matrix build if you need + # cross-platform coverage. + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + + steps: + - uses: actions/checkout@v2 + + - name: Install OpenGL + run: sudo apt install mesa-common-dev libglu1-mesa-dev freeglut3-dev + if: matrix.os == 'ubuntu-latest' + + - name: Install USBlib + run: sudo apt-get install libudev-dev + if: matrix.os == 'ubuntu-latest' + + - name: Configure CMake + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUIL D_TYPE.html?highlight=cmake_build_type + run: cmake -S ${{github.workspace}}/core -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + + - name: linux dependency + shell: bash + run: | + ldd ${{github.workspace}}/build/xp11/lin.xpl > ${{github.workspace}}/build/xp11/lin.txt + if: matrix.os == 'ubuntu-latest' + + - name: macos dependency + shell: bash + run: | + otool -L ${{github.workspace}}/build/xp11/mac.xpl > ${{github.workspace}}/build/xp11/mac.txt + if: matrix.os == 'macos-latest' + + - name: Upload build + uses: actions/upload-artifact@v2 + with: + name: buildoutput + path: ${{github.workspace}}/build/xp11 + + jbrelease: + needs: build + runs-on: ubuntu-latest + steps: + - name: Set enviroment for release + run: | + echo "RELEASE_TAG=v1.0.0" >> $GITHUB_ENV + echo "RELEASE_NAME=$GITHUB_WORKFLOW" >> $GITHUB_ENV + + - name: Download artifact + uses: actions/download-artifact@v2 + with: + name: buildoutput + + - name: Upload to Release + uses: meeDamian/github-release@2.0 + with: + # tag: ${{ env.RELEASE_TAG }} + draft: true + allow_override: true + gzip: false + token: ${{ secrets.GITHUB_TOKEN }} + files: > + lin.xpl + lin.txt + mac.xpl + mac.txt + Release/win.xpl + + |