Skip to content

workflow fix

workflow fix #17

Workflow file for this run

name: 'Build and Release DEB Package'
on:
push:
branches:
- master
- main
- feature/github_actions
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y qtbase5-dev qt5-qmake qttools5-dev-tools qtmultimedia5-dev \
build-essential debhelper devscripts
- name: Build Project
run: |
qmake
make
- name: Prepare Debian Package
run: |
mkdir -p debian/qstamina/DEBIAN
mkdir -p debian/qstamina/usr/share/qstamina
mkdir -p debian/qstamina/usr/share/applications
mkdir -p debian/qstamina/usr/bin
mkdir -p debian/qstamina/usr/share/icons
mkdir -p debian/qstamina/usr/share/icons/hicolor/16x16/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/32x32/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/48x48/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/128x128/apps
mkdir -p debian/qstamina/usr/share/icons/hicolor/256x256/apps
# Copy resources
cp -r src/resources/* debian/qstamina/usr/share/qstamina/
# Copy binary
cp QStamina debian/qstamina/usr/bin/qstamina
# copy deskop entry
mv debian/qstamina/usr/share/qstamina/qstamina.desktop debian/qstamina/usr/share/applications/qstamina.desktop
# Create control file
cat > debian/qstamina/DEBIAN/control << EOF
Package: qstamina
Version: ${GITHUB_REF_NAME#v}
Architecture: amd64
Maintainer: Zer0C00I
Depends: libqt5core5a, libqt5gui5, libqt5widgets5, libqtmultimedia5
Description: Typing tutor software
QStamina is a typing tutor that helps users improve their typing speed.
EOF
- name: Build DEB Package
run: |
cd debian/qstamina
dpkg-deb --build . ../qstamina_${GITHUB_REF_NAME#v}.deb
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: Release ${{ github.run_number }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./debian/qstamina_${{ github.run_number }}.deb
asset_name: qstamina_${{ github.run_number }}.deb
asset_content_type: application/vnd.debian.binary-package