|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: ${{ matrix.target }}-${{ matrix.qt-version }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + target: |
| 18 | + - ubuntu-latest |
| 19 | + qt-version: |
| 20 | + - qt5 |
| 21 | + - qt6 |
| 22 | + runs-on: ${{ matrix.target }} |
| 23 | + env: |
| 24 | + qt6: ${{ matrix.qt-version == 'qt6' && 'yes' || 'no' }} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + |
| 28 | + - name: Install devscripts |
| 29 | + run: | |
| 30 | + sudo apt -qq update |
| 31 | + sudo apt -y dist-upgrade |
| 32 | + sudo DEBIAN_FRONTEND=noninteractive apt install -qq devscripts equivs lintian |
| 33 | + mk-build-deps -i -s sudo -t "apt --yes --no-install-recommends" |
| 34 | +
|
| 35 | + - name: Build source package |
| 36 | + env: |
| 37 | + DEBFULLNAME: "Jakob Flierl" |
| 38 | + DEBEMAIL: "jakob.flierl@gmail.com" |
| 39 | + run: | |
| 40 | + export TARGET=$(. /etc/lsb-release && echo $DISTRIB_CODENAME) |
| 41 | + git fetch --unshallow |
| 42 | + git fetch --tags |
| 43 | + VERSION="$(git tag -l | tail -n1 | sed -e "s/^v//" -e "s/-/+git/")" |
| 44 | + DEBEMAIL="${DEBEMAIL}" dch --create \ |
| 45 | + --distribution ${TARGET} \ |
| 46 | + --package libqgcodeeditor \ |
| 47 | + --newversion ${VERSION}~${TARGET}1 \ |
| 48 | + "Automatic release build" |
| 49 | + debuild -S -sa -us -uc -d |
| 50 | +
|
| 51 | + - name: Clean and rebuild packages |
| 52 | + run: | |
| 53 | + rm -rf QGcodeQt5 QGcodeQt6 configure-stamp build-library-stamp debian/tmp debian/libqgcodeeditor-qt* debian/*.debhelper.log debian/*.substvars |
| 54 | + dpkg-buildpackage -b -rfakeroot -us -uc |
| 55 | +
|
| 56 | + - name: Run lintian |
| 57 | + run: | |
| 58 | + lintian ../libqgcodeeditor*.deb | lintian-info |
| 59 | +
|
| 60 | + - name: Upload artifacts |
| 61 | + run: | |
| 62 | + mkdir -p artifacts |
| 63 | + cp ../*.buildinfo ../*.changes ../*.dsc ../*.tar.* ../*.deb artifacts/ 2>/dev/null || true |
| 64 | +
|
| 65 | + - uses: actions/upload-artifact@v4 |
| 66 | + with: |
| 67 | + name: ${{ matrix.target }}-${{ matrix.qt-version }} |
| 68 | + if-no-files-found: error |
| 69 | + path: artifacts |
| 70 | + |
| 71 | + release: |
| 72 | + name: Release |
| 73 | + needs: build |
| 74 | + runs-on: ubuntu-latest |
| 75 | + permissions: |
| 76 | + contents: write |
| 77 | + steps: |
| 78 | + - uses: actions/download-artifact@v4 |
| 79 | + with: |
| 80 | + pattern: '*' |
| 81 | + path: artifacts |
| 82 | + merge-multiple: true |
| 83 | + |
| 84 | + - name: Create Release |
| 85 | + uses: softprops/action-gh-release@v1 |
| 86 | + with: |
| 87 | + files: artifacts/* |
| 88 | + generate_release_notes: true |
| 89 | + env: |
| 90 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments