github action安装qt

我做了一个可以在github action编译qt的yml文件

name: Qt
on: 
  # push代码时触发workflow
  push:
    # 忽略README.md
    paths-ignore:
      - 'README.md'
      - 'LICENSE'
  # pull_request时触发workflow
  pull_request:
    # 忽略README.md
    paths-ignore:
      - 'README.md'
      - 'LICENSE'
jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, macOS-latest, windows-latest]
      fail-fast: false
    name: ${{ matrix.os }}
    steps:
    - name: Git checkout
      uses: actions/checkout@v3
    - name: Install Qt windows 
      if: matrix.os == 'windows-latest'
      uses: jurplel/install-qt-action@v3
      with:
        version: '6.2.2'
        arch: 'win64_mingw'
    - name: Install Qt linux 
      if: matrix.os == 'ubuntu-latest'
      uses: jurplel/install-qt-action@v3
      with:
        version: '6.2.*'
        target: 'desktop'
    - name: Install Qt mac
      if: matrix.os == 'macOS-latest'
      uses: jurplel/install-qt-action@v3
      with:
        version: '6.2.*'
        target: 'desktop'
    - name: Set up MinGW
      if: matrix.os == 'windows-latest'
      uses: egor-tensin/setup-mingw@v2
      with:
          platform: x64
    - name: compile qmake
      run:  qmake
    - name: compile make mac
      if: matrix.os == 'macOS-latest'
      run:  make
    - name: compile make linux
      if: matrix.os == 'ubuntu-latest'
      run:  make
    - name: compile make win
      if: matrix.os == 'windows-latest'
      shell: cmd
      run: |
        mingw32-make
    - name: pack win exe
      if: matrix.os == 'windows-latest'
      run: |
        mkdir app
        cp release/class-manager.exe app
        cd app
        windeployqt class-manager.exe
    - name: pack linux app
      if: matrix.os == 'ubuntu-latest'
      run: |
        mkdir app
        cp class-manager app
    - name: pack mac app
      if: matrix.os == 'macOS-latest'
      run: |
        mkdir app
        ls -ae
        cp class-manager.app/Contents/MacOS/class-manager app
    - name: gzip
      run: |
        tar -czvf app.tar.gz app

还未完成发布,正在努力

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值