hopefully everything works now #35
This file contains 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 GUI (Linux x64) | |
on: | |
pull_request: | |
branches: | |
- master | |
push: | |
branches: | |
- master | |
jobs: | |
build-pornfetch-gui-linux-x64: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Python 3.11 x64 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
architecture: x64 | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install virtualenv | |
virtualenv venv | |
source venv/bin/activate | |
pip install -r requirements.txt | |
pip install PySide6 nuitka zstandard | |
- name: Build application for x64 | |
run: | | |
mkdir deploy | |
shopt -s extglob | |
mv !(deploy|venv) deploy/ # Ensure venv is not moved | |
cd deploy | |
pwd | |
ls -la | |
source ../venv/bin/activate | |
pyside6-deploy -c src/build/pysidedeploy_linux.spec main.py | |
- name: Archive x64 build | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pyside6-application-x64 | |
path: deploy/main.bin | |
create-release: | |
needs: build-pornfetch-gui-linux-x64 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install gh CLI | |
run: | | |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | |
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
sudo apt update | |
sudo apt install gh -y | |
- name: Download Linux x64 artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: pyside6-application-x64 | |
path: ./artifacts | |
- name: Get short SHA | |
id: vars | |
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV | |
- name: Check if Release Exists | |
id: check_release | |
run: | | |
gh release view v1.0.0-automated-${{ env.GITHUB_SHA_SHORT }} >/dev/null 2>&1 && echo "RELEASE_EXISTS=true" || echo "RELEASE_EXISTS=false" | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
- name: Set RELEASE_EXISTS | |
run: echo "RELEASE_EXISTS=${{ steps.check_release.outputs.RELEASE_EXISTS }}" >> $GITHUB_ENV | |
- name: Create GitHub Release | |
id: create_release | |
if: steps.check_release.outputs.RELEASE_EXISTS == 'false' | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
with: | |
tag_name: v1.0.0-automated-${{ env.GITHUB_SHA_SHORT }} | |
release_name: Automated Release v1.0.0-${{ env.GITHUB_SHA_SHORT }} | |
body: | | |
This is an automated release generated by the CI/CD pipeline. | |
draft: false | |
prerelease: true | |
- name: Get Release Upload URL | |
if: steps.check_release.outputs.RELEASE_EXISTS == 'true' | |
id: get_release_url | |
run: | | |
UPLOAD_URL=$(gh release view v1.0.0-automated-${{ env.GITHUB_SHA_SHORT }} --json upload_url --jq .upload_url) | |
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAT }} | |
shell: bash | |
- name: Upload Linux x64 artifact to release | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url || steps.get_release_url.outputs.upload_url }} | |
asset_path: ./artifacts/main.bin | |
asset_name: PornFetch_GUI_Linux_x64.bin | |
asset_content_type: application/octet-stream |