X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=.github%2Fworkflows%2Fmain.yml;h=2bcfc196d4fb156905e446e139e2176e106a3bde;hp=9c589fd2e16d2043cfeb1f8263fb7fe7abb2f654;hb=HEAD;hpb=8c0f742c0d1732cde866011b56fa5d1725e0d668 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c589fd2..3d83abb6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,7 +3,16 @@ # and attaching Windows and macOS builds, as well as the source archive. name: Quassel CI -on: [ push, pull_request ] +on: + push: + pull_request: + schedule: + # * is a special character in YAML so you have to quote this string + # Run at 13:37 on the 14th of every month (odd time to reduce load) + - cron: '37 13 14 * *' + +# Can't use simpler definition of [ push, pull_request, schedule ] +# See https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events defaults: run: @@ -17,9 +26,10 @@ jobs: runs-on: ubuntu-latest container: quassel/quassel-build-env:${{ matrix.dist }} strategy: + fail-fast: false matrix: - dist: [ debian-stable, debian-testing, ubuntu-xenial, ubuntu-bionic, ubuntu-eoan, ubuntu-focal ] - cxx: [ gcc, clang++ ] + dist: [ debian-stable, debian-testing, ubuntu-xenial, ubuntu-bionic, ubuntu-focal, ubuntu-groovy ] + cxx: [ 'g++', 'clang++' ] with-kde: [ -DWITH_KDE=ON ] extra-options: [ -DWITH_WEBENGINE=ON ] include: @@ -38,6 +48,7 @@ jobs: CCACHE_BASEDIR: ${{ github.workspace }} CCACHE_DIR: ${{ github.workspace }}/ccache CCACHE_MAXSIZE: 100M + CXX: ${{ matrix.cxx }} steps: - name: Check out source code @@ -91,6 +102,13 @@ jobs: CCACHE_MAXSIZE: 100M steps: + - name: Select Xcode version + uses: maxim-lobanov/setup-xcode@v1 + with: + # Newer Xcode versions may not officially be supported by Qt + # Check https://doc.qt.io/qt-5/macos.html + xcode-version: '12.4.0' + - name: Check out source code uses: actions/checkout@v2 with: @@ -101,7 +119,18 @@ jobs: run: git fetch -f origin $GITHUB_REF:$GITHUB_REF - name: Install dependencies - run: brew update && brew install boost ccache ninja qca qt5 + # Skip "brew update" as it can trigger 50+ minutes of updating. + # GitHub Actions intentionally disables the default auto-update on their + # macOS CI images (and macOS CI images usually update once a week). + # + # See https://github.com/actions/virtual-environments/issues/2173 + # > We've set no auto-update intentionally here [...] + # And https://github.com/microsoft/appcenter/issues/293 + # + # If Homebrew begins failing in the future due to out-of-date versions, + # it can be re-enabled here as follows... + # run: brew update && [below command] + run: brew install boost ccache ninja qca qt@5 - name: Get timestamp id: get-timestamp @@ -123,24 +152,25 @@ jobs: mkdir build cd build && cmake $GITHUB_WORKSPACE \ -GNinja \ - -DCMAKE_PREFIX_PATH=/usr/local/opt/qt/lib/cmake \ + -DWANT_CORE=ON \ + -DWANT_QTCLIENT=ON \ + -DWANT_MONO=ON \ + -DCMAKE_PREFIX_PATH=$(brew --prefix)/opt/qt@5 \ + -DCMAKE_INSTALL_PREFIX=$GITHUB_WORKSPACE/bundles \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_TESTING=ON \ -DFATAL_WARNINGS=OFF \ - -DDEPLOY=ON \ - -DENABLE_SHARED=OFF + -DENABLE_SHARED=OFF \ + -DBUNDLE=ON \ - name: Build - run: | - # Deploy scripts require qmake in the path - export PATH=$PATH:/usr/local/opt/qt5/bin - cd build && ninja + run: cd build && ninja - name: Run tests run: cd build && ctest - name: Install - run: cd build && DESTDIR=$GITHUB_WORKSPACE/image ninja install + run: cd build && ninja install - name: Print ccache stats run: ccache -s @@ -149,7 +179,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: macOS - path: ${{ github.workspace }}/build/*.dmg + path: ${{ github.workspace }}/bundles/*.dmg # ------------------------------------------------------------------------------------------------------------------------------------------ build-windows: @@ -200,10 +230,9 @@ jobs: path: ${{ github.workspace }}/packages/* # ------------------------------------------------------------------------------------------------------------------------------------------ - create-release: - name: Create release + post-build: + name: Post-Build runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') needs: [ build-linux, build-macos, build-windows ] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -213,15 +242,9 @@ jobs: uses: actions/checkout@v2 - name: Fetch tag information + if: startsWith(github.ref, 'refs/tags/') run: git fetch -f origin $GITHUB_REF:$GITHUB_REF - - name: Create release notes - run: | - # Use the tag's annotation as release notes - TAGNAME=$(git rev-parse --abbrev-ref $GITHUB_REF) - MESSAGE=$(git tag -l --format='%(contents)' $TAGNAME | perl -ne 'print if not /-----BEGIN PGP SIGNATURE-----/../-----END PGP SIGNATURE-----/') - echo -e "Quassel $TAGNAME\n\n$MESSAGE" > release_notes.txt - - name: Download artifacts uses: actions/download-artifact@v2 with: @@ -230,13 +253,28 @@ jobs: - name: List artifacts run: ls -lhR artifacts + - name: Check artifacts + run: | + # Sanity check: We should have exactly 5 files matching the given patterns + [[ 5 -eq $(find artifacts/ \( -type f -name 'Quassel*.dmg' -o -name 'quassel*.exe' -o -name 'quassel*.7z' \) -printf '.' | wc -c) ]] + + - name: Create release notes + if: startsWith(github.ref, 'refs/tags/') + run: | + # Use the tag's annotation as release notes + TAGNAME=$(git rev-parse --abbrev-ref $GITHUB_REF) + MESSAGE=$(git tag -l --format='%(contents)' $TAGNAME | perl -ne 'print if not /-----BEGIN PGP SIGNATURE-----/../-----END PGP SIGNATURE-----/') + echo -e "Quassel $TAGNAME\n\n$MESSAGE" > release_notes.txt + - name: Prepare source archive + if: startsWith(github.ref, 'refs/tags/') run: | mkdir assets TAGNAME=$(git rev-parse --abbrev-ref $GITHUB_REF) git archive --format=tar --prefix=quassel-$TAGNAME/ $TAGNAME | xz > assets/quassel-$TAGNAME.tar.xz - name: Prepare packages for release + if: startsWith(github.ref, 'refs/tags/') run: | TAGNAME=$(git rev-parse --abbrev-ref $GITHUB_REF) for type in Client Core Mono; do @@ -246,9 +284,11 @@ jobs: mv artifacts/Windows/quassel-*.7z assets/quassel-windows-$TAGNAME.7z - name: Create checksums for release assets + if: startsWith(github.ref, 'refs/tags/') run: find assets/ -type f -execdir sh -c 'sha256sum "$1" > "$1.sha256sum"' _ {} \; - name: Create draft release + if: startsWith(github.ref, 'refs/tags/') run: | # The stock upload-release-asset action can only handle single files # Instead, use the hub utility so we can upload all assets at once