Skip to content

Commit

Permalink
fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
danyworks committed Sep 25, 2024
1 parent 2aefc31 commit 90614da
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 73 deletions.
85 changes: 40 additions & 45 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
name: ' '
name: 'Build Linux'

on:
push:
tags:
- '*'
workflow_call:
inputs:
python_version:
description: 'Python version to use'
required: false
default: '3.10'
type: string
chromium_version:
description: 'Ungoogled Chromium version'
required: false
default: '129.0.6668.58-1'
type: string
chromedriver_version:
description: 'ChromeDriver version'
required: false
default: '131.0.6724.0'
type: string

env:
python_version: '3.10'
chromium_version: '129.0.6668.58-1'
chromium_base_url: 'https://github.com/ungoogled-software/ungoogled-chromium-portablelinux/releases/download'
CHROMIUM_BASE_URL: 'https://github.com/ungoogled-software/ungoogled-chromium-portablelinux/releases/download'
CHROMIUM_ARCHIVE_NAME: 'ungoogled-chromium.tar.xz'
CHROMEDRIVER_BASE_URL: 'https://storage.googleapis.com/chrome-for-testing-public'
CHROMEDRIVER_ARCHIVE_NAME: 'chromedriver.zip'
OUTPUT_DIR: 'ungoogled_chromium'

jobs:
build-linux:
Expand All @@ -21,7 +37,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}
python-version: ${{ inputs.python_version }}

- name: Install Pipenv
run: pip install --user pipenv
Expand All @@ -34,51 +50,30 @@ jobs:
id: cache-chromium
uses: actions/cache@v4
with:
path: ./ungoogled_chromium
key: ${{ runner.os }}-chromium-${{ hashFiles('**/${{ env.chromium_version }}_linux.tar.xz') }}
path: ${{ env.OUTPUT_DIR }}
key: ${{ runner.os }}-chromium-${{ inputs.chromium_version }}

- name: Download Ungoogled Chromium
if: steps.cache-chromium.outputs.cache-hit != 'true'
run: |
curl -L -o ungoogled-chromium.tar.xz ${CHROMIUM_BASE_URL}/${{ env.chromium_version }}/ungoogled-chromium_${{ env.chromium_version }}_linux.tar.xz
mkdir -p ./ungoogled_chromium
tar -xvf ungoogled-chromium.tar.xz -C ./ungoogled_chromium
curl -L -o ${{ env.CHROMIUM_ARCHIVE_NAME }} ${{ env.CHROMIUM_BASE_URL }}/${{ inputs.chromium_version }}/ungoogled-chromium_${{ inputs.chromium_version }}_linux.tar.xz
mkdir -p ${{ env.OUTPUT_DIR }}
tar -xvf ${{ env.CHROMIUM_ARCHIVE_NAME }} -C ${{ env.OUTPUT_DIR }}
- name: Debug - List current directory
run: |
echo "Current directory contents:"
ls -R
echo "Ungoogled Chromium directory contents:"
ls -R ./ungoogled_chromium/ungoogled-chromium_${{ env.chromium_version }}_linux
- name: Debug - Print working directory
run: |
echo "Current working directory:"
pwd
- name: Debug - List Ungoogled Chromium directory
run: |
echo "Ungoogled Chromium directory contents:"
ls -R ./ungoogled_chromium
- name: Debug - Print environment variables
run: |
echo "Environment variables:"
env
- name: Cache ChromeDriver
id: cache-chromedriver
uses: actions/cache@v4
with:
path: ${{ env.OUTPUT_DIR }}/chromedriver
key: ${{ runner.os }}-chromedriver-${{ inputs.chromedriver_version }}

- name: Debug - Check Python and Pipenv versions
- name: Download ChromeDriver
if: steps.cache-chromedriver.outputs.cache-hit != 'true'
run: |
echo "Python version:"
python --version
echo "Pipenv version:"
pipenv --version
curl -L -o ${{ env.CHROMEDRIVER_ARCHIVE_NAME }} ${{ env.CHROMEDRIVER_BASE_URL }}/${{ inputs.chromedriver_version }}/linux64/chromedriver-linux64.zip
mkdir -p ${{ env.OUTPUT_DIR }}/chromedriver
unzip ${{ env.CHROMEDRIVER_ARCHIVE_NAME }} -d ${{ env.OUTPUT_DIR }}/chromedriver
- name: Debug - List Pipenv virtual environment
run: |
echo "Pipenv virtual environment:"
pipenv --venv
echo "Pipenv virtual environment contents:"
ls -R $(pipenv --venv)
# - name: Package the app using PyInstaller
# run: pipenv run pyinstaller main.spec

Expand Down
37 changes: 24 additions & 13 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
name: ' '
name: 'Build macOS'

on:
push:
tags:
- '*'
workflow_call:
inputs:
python_version:
description: 'Python version to use'
required: false
default: '3.10'
type: string
chromium_version:
description: 'Ungoogled Chromium version'
required: false
default: '129.0.6668.58-1.1'
type: string
chromedriver_version:
description: 'ChromeDriver version'
required: false
default: '131.0.6724.0'
type: string

env:
PYTHON_VERSION: '3.10'
CHROMIUM_VERSION: '129.0.6668.58-1.1'
CHROMIUM_BASE_URL: 'https://github.com/ungoogled-software/ungoogled-chromium-macos/releases/download'
CHROMEDRIVER_VERSION: '131.0.6724.0'
CHROMEDRIVER_BASE_URL: 'https://storage.googleapis.com/chrome-for-testing-public'

jobs:
Expand All @@ -23,7 +34,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ inputs.python_version }}

- name: Install pipenv
run: pip install --user pipenv
Expand All @@ -37,12 +48,12 @@ jobs:
uses: actions/cache@v4
with:
path: ./ungoogled_chromium
key: ${{ runner.os }}-chromium-${{ hashFiles('**/${{ env.CHROMIUM_VERSION }}_x86-64-macos.dmg') }}
key: ${{ runner.os }}-chromium-${{ inputs.chromium_version }}

- name: Download Ungoogled Chromium
if: steps.cache-chromium.outputs.cache-hit != 'true'
run: |
curl -L -o ungoogled-chromium.dmg ${CHROMIUM_BASE_URL}/${{ env.CHROMIUM_VERSION }}/ungoogled-chromium_${{ env.CHROMIUM_VERSION }}_x86-64-macos.dmg
curl -L -o ungoogled-chromium.dmg ${CHROMIUM_BASE_URL}/${{ inputs.chromium_version }}/ungoogled-chromium_${{ inputs.chromium_version }}_x86-64-macos.dmg
mkdir -p ./ungoogled_chromium
hdiutil attach ungoogled-chromium.dmg
cp -R /Volumes/Ungoogled-Chromium/Ungoogled-Chromium.app ./ungoogled_chromium/
Expand All @@ -54,12 +65,12 @@ jobs:
uses: actions/cache@v4
with:
path: ./ungoogled_chromium/chromedriver
key: ${{ runner.os }}-chromedriver-${{ hashFiles('**/${{ env.CHROMEDRIVER_BASE_URL }}/${{ env.CHROMEDRIVER_VERSION }}/mac-x64/chromedriver-mac-x64.zip') }}
key: ${{ runner.os }}-chromedriver-${{ inputs.chromedriver_version }}

- name: Download ChromeDriver
if: steps.cache-chromedriver.outputs.cache-hit != 'true'
run:
curl -L -o chromedriver.zip ${CHROMEDRIVER_BASE_URL}/${{ env.CHROMEDRIVER_VERSION }}/mac-x64/chromedriver-mac-x64.zip
run: |
curl -L -o chromedriver.zip ${CHROMEDRIVER_BASE_URL}/${{ inputs.chromedriver_version }}/mac-x64/chromedriver-mac-x64.zip
unzip chromedriver.zip
mv chromedriver ./ungoogled_chromium/
ls -la ./ungoogled_chromium
Expand Down
43 changes: 28 additions & 15 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
name: ' '
name: 'Build Windows'

on:
push:
tags:
- '*'
workflow_call:
inputs:
python_version:
description: 'Python version to use'
required: false
default: '3.10'
type: string
chromium_version:
description: 'Ungoogled Chromium version'
required: false
default: '129.0.6668.58-1.1'
type: string
chromedriver_version:
description: 'ChromeDriver version'
required: false
default: '131.0.6724.0'
type: string

env:
PYTHON_VERSION: '3.10'
CHROMIUM_VERSION: '129.0.6668.58-1.1'
CHROMIUM_BASE_URL: 'https://github.com/ungoogled-software/ungoogled-chromium-windows/releases/download'
CHROMIUM_ARCHIVE_NAME: 'ungoogled-chromium.zip'
CHROMIUM_FOLDER_NAME: 'ungoogled-chromium_${{ env.CHROMIUM_VERSION }}_windows_x64'
CHROMEDRIVER_BASE_URL: 'https://storage.googleapis.com/chrome-for-testing-public/131.0.6724.0/win64/chromedriver-win64.zip'
CHROMEDRIVER_BASE_URL: 'https://storage.googleapis.com/chrome-for-testing-public'
CHROMEDRIVER_ARCHIVE_NAME: 'chromedriver.zip'
OUTPUT_DIR: 'ungoogled_chromium'

jobs:
build-windows:
name: Bundle Executable
Expand All @@ -25,7 +37,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ inputs.python_version }}

- name: Install Pipenv
run: pip install --user pipenv
Expand All @@ -39,30 +51,31 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ env.OUTPUT_DIR }}
key: ${{ runner.os }}-chromium-${{ hashFiles('**/${{ env.CHROMIUM_VERSION }}_windows_x64.zip') }}
key: ${{ runner.os }}-chromium-${{ inputs.chromium_version }}

- name: Download Ungoogled Chromium
if: steps.cache-chromium.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri "${{ env.CHROMIUM_BASE_URL }}/${{ env.CHROMIUM_VERSION }}/${{ env.CHROMIUM_FOLDER_NAME }}.zip" -OutFile ${{ env.CHROMIUM_ARCHIVE_NAME }}
$CHROMIUM_FOLDER_NAME = "ungoogled-chromium_${{ inputs.chromium_version }}_windows_x64"
Invoke-WebRequest -Uri "${{ env.CHROMIUM_BASE_URL }}/${{ inputs.chromium_version }}/${CHROMIUM_FOLDER_NAME}.zip" -OutFile ${{ env.CHROMIUM_ARCHIVE_NAME }}
New-Item -Path ${{ env.OUTPUT_DIR }} -ItemType Directory -Force
Expand-Archive -Path ${{ env.CHROMIUM_ARCHIVE_NAME }} -DestinationPath ${{ env.OUTPUT_DIR }}
Get-ChildItem -Path ${{ env.OUTPUT_DIR }} -Recurse
Get-ChildItem -Path "${{ env.OUTPUT_DIR }}\${{ env.CHROMIUM_FOLDER_NAME }}" -Recurse
Get-ChildItem -Path "${{ env.OUTPUT_DIR }}\${CHROMIUM_FOLDER_NAME}" -Recurse
- name: Cache ChromeDriver
id: cache-chromedriver
uses: actions/cache@v4
with:
path: ${{ env.OUTPUT_DIR }}\chromedriver
key: ${{ runner.os }}-chromedriver-${{ env.CHROMEDRIVER_VERSION }}
key: ${{ runner.os }}-chromedriver-${{ inputs.chromedriver_version }}

- name: Download ChromeDriver
if: steps.cache-chromedriver.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri "${{ env.CHROMEDRIVER_BASE_URL }}" -OutFile chromedriver.zip
Invoke-WebRequest -Uri "${{ env.CHROMEDRIVER_BASE_URL }}/${{ inputs.chromedriver_version }}/win64/chromedriver-win64.zip" -OutFile ${{ env.CHROMEDRIVER_ARCHIVE_NAME }}
New-Item -Path ${{ env.OUTPUT_DIR }}\chromedriver -ItemType Directory -Force
Expand-Archive -Path chromedriver.zip -DestinationPath ${{ env.OUTPUT_DIR }}\chromedriver
Expand-Archive -Path ${{ env.CHROMEDRIVER_ARCHIVE_NAME }} -DestinationPath ${{ env.OUTPUT_DIR }}\chromedriver
# - name: Package the app using PyInstaller
# run: pipenv run pyinstaller main.spec
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,26 @@ jobs:
build-linux:
name: Linux x64
uses: ./.github/workflows/build-linux.yml
with:
python_version: '3.10'
chromium_version: '129.0.6668.58-1'
chromedriver_version: '131.0.6724.0'

build-macos:
name: macOS x64
uses: ./.github/workflows/build-macos.yml
with:
python_version: '3.10'
chromium_version: '129.0.6668.58-1.1'
chromedriver_version: '131.0.6724.0'

build-windows:
name: Windows x64
uses: ./.github/workflows/build-windows.yml
with:
python_version: '3.10'
chromium_version: '129.0.6668.58-1.1'
chromedriver_version: '131.0.6724.0'

build-docker:
name: Docker
Expand Down

0 comments on commit 90614da

Please sign in to comment.