Skip to content

Build Linux with Release #23

Build Linux with Release

Build Linux with Release #23

Workflow file for this run

name: Build Linux with Release
on:
workflow_dispatch:
permissions:
contents: write
issues: write
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get version from file
run: echo "VERSION=$(<VERSION)" >> $GITHUB_ENV
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3.9 python3.9-venv python3.9-dev build-essential
python3.9 -m pip install --upgrade pip
# Nuitka 1.9.7 is required as versions after 1.9 have changed behavior regarding the inclusion of libraries, leading to missing xcb components.
pip install nuitka==1.9.7 PySide6 base58==2.1.1 cryptography==42.0.8 mnemonic==0.21 PySide6==6.6.1 PySide6_Addons==6.6.1 PySide6_Essentials==6.6.1 shiboken6==6.6.1
- name: Compile with Nuitka
run: |
python3.9 -m nuitka --follow-imports --include-package=cryptography --include-module=mnemonic --include-package=src --enable-plugin=pyside6 --include-data-dir=./src/gui/qt/translation=src/gui/qt/translation --disable-console --standalone --output-dir=./dist --output-filename=eMinuto main_qt.py --assume-yes-for-downloads
shell: bash
- name: Debug - List dist directory contents
run: |
echo "Contents of ./dist directory:"
ls -l ./dist
echo "Contents of ./dist/main_qt.dist directory:"
ls -l ./dist/main_qt.dist
- name: Verify Compiled File
run: |
if [ ! -f "./dist/main_qt.dist/eMinuto" ]; then
echo "Compiled file not found!"
exit 1
else
echo "Compiled file found at ./dist/main_qt.dist/eMinuto"
fi
- name: Rename Directory
run: mv ./dist/main_qt.dist ./dist/eMinuto
- name: Create Archive
run: |
tar -czvf ./dist/eMinuto-${{ env.VERSION }}-linux.tar.gz -C ./dist eMinuto
- name: Check if release exists
id: check_release
uses: actions/github-script@v6
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
});
const release = releases.data.find(release => release.tag_name === `v${process.env.VERSION}`);
if (release) {
core.setOutput('release_id', release.id);
core.setOutput('upload_url', release.upload_url);
} else {
core.setOutput('release_id', '');
core.setOutput('upload_url', '');
}
- name: Debug - Check Release Outputs
run: |
echo "Release ID: ${{ steps.check_release.outputs.release_id }}"
echo "Upload URL: ${{ steps.check_release.outputs.upload_url }}"
- name: Create Release
if: ${{ steps.check_release.outputs.release_id == '' }}
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.VERSION }}
release_name: eMinuto v${{ env.VERSION }}
draft: false
prerelease: false
- name: Debug - New Release Outputs
if: ${{ steps.check_release.outputs.release_id == '' }}
run: |
echo "New release created."
echo "Upload URL: ${{ steps.create_release.outputs.upload_url }}"
- name: Set Upload URL for New Release
if: ${{ steps.check_release.outputs.release_id == '' }}
run: echo "UPLOAD_URL=${{ steps.create_release.outputs.upload_url }}" >> $GITHUB_ENV
- name: Set Upload URL for Existing Release
if: ${{ steps.check_release.outputs.release_id != '' }}
run: echo "UPLOAD_URL=${{ steps.check_release.outputs.upload_url }}" >> $GITHUB_ENV
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_URL: ${{ steps.create_release.outputs.upload_url || steps.check_release.outputs.upload_url }}
with:
upload_url: ${{ env.UPLOAD_URL }}
asset_path: ./dist/eMinuto-${{ env.VERSION }}-linux.tar.gz
asset_name: eMinuto-${{ env.VERSION }}-linux.tar.gz
asset_content_type: application/gzip