Repository navigation
Build .deb Package #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build .deb Package | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| DEB_ROOT: "memerist-amd64" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Build Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y meson ninja-build libgtk-4-dev libadwaita-1-dev gettext desktop-file-utils | |
| - name: Compile (Meson) | |
| run: | | |
| meson setup build --prefix=/usr | |
| meson compile -C build | |
| - name: Extract Version | |
| id: get_version | |
| run: | | |
| VERSION=$(grep "^Version:" memerist.spec | awk '{print $2}') | |
| RELEASE=$(grep "^Release:" memerist.spec | awk '{print $2}' | sed 's/%{?dist}//') | |
| echo "full_version=${VERSION}-${RELEASE}" >> $GITHUB_OUTPUT | |
| - name: Package | |
| run: | | |
| mkdir -p ${{ env.DEB_ROOT }}/DEBIAN | |
| meson install -C build --destdir ${{ github.workspace }}/${{ env.DEB_ROOT }} | |
| printf "Package: memerist\nVersion: ${{ steps.get_version.outputs.full_version }}\nSection: utils\nPriority: optional\nArchitecture: amd64\nDepends: libgtk-4-1, libglib2.0-0, libadwaita-1-0\nMaintainer: Vani1-2 <giovannirafanan609@gmail.com>\nDescription: Meme editor for the GNOME Desktop\n" > ${{ env.DEB_ROOT }}/DEBIAN/control | |
| cat ${{ env.DEB_ROOT }}/DEBIAN/control | |
| dpkg-deb --build ${{ env.DEB_ROOT }} | |
| mv ${{ env.DEB_ROOT }}.deb memerist_${{ steps.get_version.outputs.full_version }}_amd64.deb | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: memerist-deb-package | |
| path: memerist_*.deb |