diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index aa6d3de..36f0aab 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -30,7 +30,7 @@ jobs: uses: actions/cache@v1 with: path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }} - key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }} + key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }} - name: Install Qt uses: jurplel/install-qt-action@v2.0.0 with: @@ -64,14 +64,14 @@ jobs: - uses: actions/upload-artifact@v1 with: name: ${{ env.artifact-name }}.zip - path: ci\build\${{ env.artifact-name }} + path: ci/build/${{ env.artifact-name }} # Upload to release - name: Upload Release if: startsWith(github.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v1-release with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ci\build\${{ env.publish_name }}.dmg + file: ci/build/${{ env.publish_name }}.dmg asset_name: ${{ env.publish_name }}.dmg tag: ${{ github.ref }} overwrite: true \ No newline at end of file diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3215bb1..66ca38f 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -19,34 +19,31 @@ jobs: matrix: os: [ubuntu-16.04,ubuntu-18.04] qt_ver: [5.12.6] - qt_arch: [gcc_64] + qt-target: [desktop] + qt-arch-install: [gcc_64] + gcc-arch: [x64] + env: + target-name: QtScrcpy + qt-install-path: ${{ github.workspace }}/${{ matrix.qt-ver }} + plantform-des: ubuntu steps: - name: Cache Qt - id: UbuntuCacheQt + id: cache-qt uses: actions/cache@v1 with: - path: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}} - key: ${{ runner.os }}-Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}} - - name: Setup Qt - if: steps.UbuntuCacheQt.outputs.cache-hit == 'true' - shell: pwsh - env: - QtPath: ../Qt/${{matrix.qt_ver}}/${{matrix.qt_arch}} - run: | - $qt_Path=${env:QtPath} - echo "::set-env name=Qt5_Dir::$qt_Path" - echo "::add-path::$qt_Path/bin" + path: ${{ env.qt-install-path }}/${{ matrix.qt-arch-install }} + key: ${{ runner.os }}/${{ matrix.qt-ver }}/${{ matrix.qt-arch-install }} - name: Install Qt - if: steps.UbuntuCacheQt.outputs.cache-hit != 'true' uses: jurplel/install-qt-action@v2.0.0 with: - version: ${{ matrix.qt_ver }} + version: ${{ matrix.qt-ver }} + cached: ${{ steps.cache-qt.outputs.cache-hit }} - name: Ubuntu install GL library run: sudo apt-get install -y libglew-dev libglfw3-dev - uses: actions/checkout@v1 with: fetch-depth: 1 - name: Build Ubuntu - run: | - export ENV_QT_GCC=$(pwd)/${{env.Qt5_Dir}} - ci/linux/build_for_ubuntu.sh release + env: + ENV_QT_PATH: ${{ env.qt-install-path }} + run: ci/linux/build_for_ubuntu.sh release diff --git a/ci/linux/build_for_ubuntu.sh b/ci/linux/build_for_ubuntu.sh index d30ac38..b67c72e 100755 --- a/ci/linux/build_for_ubuntu.sh +++ b/ci/linux/build_for_ubuntu.sh @@ -6,8 +6,9 @@ echo check ENV echo --------------------------------------------------------------- # 从环境变量获取必要参数 -# 例如 /home/barry/Qt5.9.6/5.9.6/gcc_64 -echo ENV_QT_GCC $ENV_QT_GCC +# 例如 /home/barry/Qt5.9.6/5.9.6 +echo ENV_QT_PATH $ENV_QT_PATH +qt_gcc_path=$ENV_QT_PATH/gcc_64 # 获取绝对路径,保证其他目录执行此脚本依然正确 { @@ -39,7 +40,7 @@ fi echo current build mode: $build_mode # 环境变量设置 -export PATH=$ENV_QT_GCC/bin:$PATH +export PATH=$qt_gcc_path/bin:$PATH echo echo